[Brett] > OK, so the question becomes how can I have test_site (which I will fix > with your suggestions for the removal of existing files and directories; > when I rewrote that chunk of code I had EAFP on the brain) test to make > sure that a module is imported? By making sure the module it imports isn't in sys.modules before it tries to import it. Beforehand: old_version = sys.modules.get(self.imported) if old_version is not None: del sys.modules[self.imported] Then make sure the .pth file puts self.imported back in sys.modules. At the end, del sys.modules[self.imported] if old_version is not None: sys.modules[self.imported] = old_version
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4