From 9e0ab0e73bb03f07b0eb6ff7f5cfd15bb0cedb15 Mon Sep 17 00:00:00 2001 From: Jeremy Fincher Date: Sun, 5 Oct 2003 21:37:29 +0000 Subject: [PATCH] *Trying*, as hard as possible, to be nice to Windows. --- plugins/Python.py | 5 ++++- test/test_Python.py | 3 ++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/plugins/Python.py b/plugins/Python.py index 6b1fde738..57026bb29 100644 --- a/plugins/Python.py +++ b/plugins/Python.py @@ -53,7 +53,10 @@ import utils import privmsgs import callbacks -pythonPath = map(os.path.dirname, [os.__file__, math.__file__]) +L = [os.__file__] +if hasattr(math, '__file__'): + L.append(math.__file__) +pythonPath = map(os.path.dirname, L) def configure(onStart, afterConnect, advanced): # This will be called by setup.py to configure this module. onStart and diff --git a/test/test_Python.py b/test/test_Python.py index 65d39886b..13cc77cba 100644 --- a/test/test_Python.py +++ b/test/test_Python.py @@ -42,7 +42,8 @@ class PythonTestCase(PluginTestCase, PluginDocumentation): if os.name == 'posix': self.assertNotRegexp('pydoc crypt.crypt', 'NameError') self.assertNotError('pydoc crypt.crypt') - self.assertNotError('pydoc math.sin') + # .so modules don't have an __file__ in Windows. + self.assertNotError('pydoc math.sin') self.assertNotError('pydoc string.translate') self.assertNotError('pydoc fnmatch.fnmatch') self.assertNotError('pydoc socket.socket')