From 776bad57001a8e45dae73a89acbee3eb8c2be300 Mon Sep 17 00:00:00 2001 From: Jeremy Fincher Date: Mon, 20 Oct 2003 22:37:33 +0000 Subject: [PATCH] Fixed bug with pydoc logging.Logger. --- plugins/Python.py | 3 ++- test/test_Python.py | 1 + 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/plugins/Python.py b/plugins/Python.py index dc94ef6e2..f1a5bc87d 100644 --- a/plugins/Python.py +++ b/plugins/Python.py @@ -116,7 +116,8 @@ class Python(callbacks.Privmsg): info = imp.find_module(name, path) newmodule = imp.load_module(name, *info) path = [os.path.dirname(newmodule.__file__)] - info[0].close() + if info[0] is not None: + info[0].close() except ImportError: irc.error(msg, 'No such module %s exists.' % name) return diff --git a/test/test_Python.py b/test/test_Python.py index 98a598ed2..e1b0a9700 100644 --- a/test/test_Python.py +++ b/test/test_Python.py @@ -48,6 +48,7 @@ class PythonTestCase(PluginTestCase, PluginDocumentation): self.assertNotError('pydoc string.translate') self.assertNotError('pydoc fnmatch.fnmatch') self.assertNotError('pydoc socket.socket') + self.assertNotError('pydoc logging.Logger') def testZen(self): self.assertNotError('zen')