I don't know why this hunk of code was there, but it was causing problems for the Plugin plugin, so I removed it.

This commit is contained in:
Jeremy Fincher 2005-02-09 07:06:05 +00:00
parent b0cb616709
commit 56ad1ead58

View File

@ -36,6 +36,7 @@ import linecache
import supybot.log as log import supybot.log as log
import supybot.conf as conf import supybot.conf as conf
import supybot.registry as registry import supybot.registry as registry
import supybot.callbacks as callbacks
class Deprecated(ImportError): class Deprecated(ImportError):
pass pass
@ -50,16 +51,6 @@ def loadPluginModule(name, ignoreDeprecation=False):
except EnvironmentError: # OSError, IOError superclass. except EnvironmentError: # OSError, IOError superclass.
log.warning('Invalid plugin directory: %s; removing.', dir) log.warning('Invalid plugin directory: %s; removing.', dir)
conf.supybot.directories.plugins().remove(dir) conf.supybot.directories.plugins().remove(dir)
loweredFiles = map(str.lower, files)
try:
index = loweredFiles.index(name.lower()+'.py')
name = os.path.splitext(files[index])[0]
if name in sys.modules:
m = sys.modules[name]
if not hasattr(m, 'Class'):
raise ImportError, 'Module is not a plugin.'
except ValueError: # We'd rather raise the ImportError, so we'll let go...
pass
moduleInfo = imp.find_module(name, pluginDirs) moduleInfo = imp.find_module(name, pluginDirs)
try: try:
module = imp.load_module(name, *moduleInfo) module = imp.load_module(name, *moduleInfo)