我们从Python开源项目中,提取了以下24个代码示例,用于说明如何使用__builtin__.unload()。
def unload(self, module): del self.modules[str(module.__name__)] # XXX Should this try to clear the module's namespace?
def install(self): self.save_import_module = __builtin__.__import__ self.save_reload = __builtin__.reload if not hasattr(__builtin__, 'unload'): __builtin__.unload = None self.save_unload = __builtin__.unload __builtin__.__import__ = self.import_module __builtin__.reload = self.reload __builtin__.unload = self.unload
def uninstall(self): __builtin__.__import__ = self.save_import_module __builtin__.reload = self.save_reload __builtin__.unload = self.save_unload if not __builtin__.unload: del __builtin__.unload