|
|
@@ -201,7 +201,7 @@ class CASFinder(MetaPathFinder, Loader): |
|
|
|
def __exit__(self, exc_type, exc_value, traceback): |
|
|
|
self.disconnect() |
|
|
|
|
|
|
|
def load_aliases(self, name): |
|
|
|
def load_mod_aliases(self, name): |
|
|
|
'''Load the aliases from the module with the passed in name.''' |
|
|
|
|
|
|
|
aliases = importlib.resources.read_text(sys.modules[name], |
|
|
@@ -337,7 +337,7 @@ def defaultinit(casf): |
|
|
|
|
|
|
|
# The global version |
|
|
|
_casfinder = CASFinder() |
|
|
|
load_aliases = _casfinder.load_aliases |
|
|
|
load_mod_aliases = _casfinder.load_mod_aliases |
|
|
|
defaultinit(_casfinder) |
|
|
|
|
|
|
|
import unittest |
|
|
@@ -504,7 +504,7 @@ class Test(unittest.TestCase): |
|
|
|
try: |
|
|
|
with CASFinder() as f, \ |
|
|
|
tempattrset(sys.modules[__name__], |
|
|
|
'load_aliases', f.load_aliases): |
|
|
|
'load_mod_aliases', f.load_mod_aliases): |
|
|
|
defaultinit(f) |
|
|
|
|
|
|
|
# and that hello.py is in the cache |
|
|
@@ -542,8 +542,8 @@ class Test(unittest.TestCase): |
|
|
|
|
|
|
|
try: |
|
|
|
with CASFinder() as f, \ |
|
|
|
tempattrset(sys.modules[__name__], 'load_aliases', |
|
|
|
f.load_aliases): |
|
|
|
tempattrset(sys.modules[__name__], 'load_mod_aliases', |
|
|
|
f.load_mod_aliases): |
|
|
|
|
|
|
|
f.register(fakeipfsloader) |
|
|
|
|
|
|
|