Fixed os.path lookups.

This commit is contained in:
Jeremy Fincher 2003-10-22 03:55:03 +00:00
parent e189603220
commit e8284ca938
2 changed files with 6 additions and 2 deletions

View File

@ -119,8 +119,11 @@ class Python(callbacks.Privmsg):
if info[0] is not None: if info[0] is not None:
info[0].close() info[0].close()
except ImportError: except ImportError:
irc.error(msg, 'No such module %s exists.' % name) if parts == ['os', 'path']:
return newmodule = os.path
else:
irc.error(msg, 'No such module %s exists.' % name)
return
if hasattr(newmodule, functionName): if hasattr(newmodule, functionName):
f = getattr(newmodule, functionName) f = getattr(newmodule, functionName)
if hasattr(f, '__doc__'): if hasattr(f, '__doc__'):

View File

@ -50,6 +50,7 @@ class PythonTestCase(PluginTestCase, PluginDocumentation):
self.assertNotError('pydoc socket.socket') self.assertNotError('pydoc socket.socket')
self.assertNotError('pydoc logging.Logger') self.assertNotError('pydoc logging.Logger')
self.assertNotRegexp('pydoc str.replace', r"^'") self.assertNotRegexp('pydoc str.replace', r"^'")
self.assertNotError('pydoc os.path.expanduser')
def testZen(self): def testZen(self):
self.assertNotError('zen') self.assertNotError('zen')