From 889ed8602612aac9e643e247d79739937ae89b06 Mon Sep 17 00:00:00 2001 From: Jeremy Fincher Date: Mon, 17 Nov 2003 06:00:56 +0000 Subject: [PATCH] Bugfixes (and removed threading). --- plugins/Python.py | 5 ++--- test/test_Python.py | 1 + 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/plugins/Python.py b/plugins/Python.py index 4d08f5685..2c164dfc4 100644 --- a/plugins/Python.py +++ b/plugins/Python.py @@ -72,7 +72,6 @@ def configure(onStart, afterConnect, advanced): class Python(callbacks.PrivmsgCommandAndRegexp, plugins.Configurable): modulechars = '%s%s%s' % (string.ascii_letters, string.digits, '_.') - threaded = True regexps = ['aspnRecipes'] configurables = plugins.ConfigurableDictionary( [('aspn-snarfer', plugins.ConfigurableBoolType, True, @@ -138,7 +137,7 @@ class Python(callbacks.PrivmsgCommandAndRegexp, plugins.Configurable): else: if hasattr(newmodule, funcName): f = getattr(newmodule, funcName) - if hasattr(f, '__doc__'): + if hasattr(f, '__doc__') and f.__doc__: s = normalize(f.__doc__) irc.reply(msg, s) else: @@ -155,7 +154,7 @@ class Python(callbacks.PrivmsgCommandAndRegexp, plugins.Configurable): irc.reply(msg, 'Module %s has no documentation.' % name) elif name in __builtins__: f = __builtins__[name] - if hasattr(f, '__doc__'): + if hasattr(f, '__doc__') and f.__doc__: irc.reply(msg, normalize(f.__doc__)) else: irc.error(msg, 'That function has no documentation.') diff --git a/test/test_Python.py b/test/test_Python.py index f35796ea1..eb7469ecf 100644 --- a/test/test_Python.py +++ b/test/test_Python.py @@ -53,6 +53,7 @@ class PythonTestCase(PluginTestCase, PluginDocumentation): self.assertNotRegexp('pydoc str.replace', r"^'") self.assertNotError('pydoc os.path.expanduser') self.assertNotRegexp('pydoc math.hypot', r'\)\.R') + self.assertNotRegexp('pydoc threading.Thread', 'NoneType') def testZen(self): self.assertNotError('zen')