Loading tests/regressiontests/utils/module_loading.py +11 −2 Original line number Diff line number Diff line Loading @@ -109,7 +109,12 @@ class ProxyFinder(object): def find_module(self, fullname, path=None): tail = fullname.rsplit('.', 1)[-1] try: self._cache[fullname] = imp.find_module(tail, path) fd, fn, info = imp.find_module(tail, path) if fullname in self._cache: old_fd = self._cache[fullname][0] if old_fd: old_fd.close() self._cache[fullname] = (fd, fn, info) except ImportError: return None else: Loading @@ -119,7 +124,11 @@ class ProxyFinder(object): if fullname in sys.modules: return sys.modules[fullname] fd, fn, info = self._cache[fullname] try: return imp.load_module(fullname, fd, fn, info) finally: if fd: fd.close() class TestFinder(object): def __init__(self, *args, **kwargs): Loading Loading
tests/regressiontests/utils/module_loading.py +11 −2 Original line number Diff line number Diff line Loading @@ -109,7 +109,12 @@ class ProxyFinder(object): def find_module(self, fullname, path=None): tail = fullname.rsplit('.', 1)[-1] try: self._cache[fullname] = imp.find_module(tail, path) fd, fn, info = imp.find_module(tail, path) if fullname in self._cache: old_fd = self._cache[fullname][0] if old_fd: old_fd.close() self._cache[fullname] = (fd, fn, info) except ImportError: return None else: Loading @@ -119,7 +124,11 @@ class ProxyFinder(object): if fullname in sys.modules: return sys.modules[fullname] fd, fn, info = self._cache[fullname] try: return imp.load_module(fullname, fd, fn, info) finally: if fd: fd.close() class TestFinder(object): def __init__(self, *args, **kwargs): Loading