From f3bef65f681d7a845a699071a0b11f3e5d68fea5 Mon Sep 17 00:00:00 2001 From: Alan McIntyre Date: Fri, 18 Jul 2008 13:00:29 +0000 Subject: Comment cleanup. Fixed __import__ calls for Python 2.4 (__import__ doesn't take keyword args in 2.4). --- numpy/testing/noseclasses.py | 7 +++---- numpy/testing/nosetester.py | 2 +- 2 files changed, 4 insertions(+), 5 deletions(-) (limited to 'numpy/testing') diff --git a/numpy/testing/noseclasses.py b/numpy/testing/noseclasses.py index 6b26a58c5..0867d5bc3 100644 --- a/numpy/testing/noseclasses.py +++ b/numpy/testing/noseclasses.py @@ -178,7 +178,7 @@ class numpyDoctest(npd.Doctest): self.finder = numpyDocTestFinder() self.parser = doctest.DocTestParser() - # Turns on whitespace normalization, set a minimal execution context + # Turn on whitespace normalization, set a minimal execution context # for doctests, implement a "#random" directive to allow executing a # command while ignoring its output. def loadTestsFromModule(self, module): @@ -221,7 +221,7 @@ class numpyDoctest(npd.Doctest): p = pkg_name.split('.') p1 = '.'.join(p[:-1]) p2 = p[-1] - test.globs[p2] = __import__(pkg_name, fromlist=[p2]) + test.globs[p2] = __import__(pkg_name, test.globs, {}, [p2]) print 'additional import for %s: from %s import %s' % (test.filename, p1, p2) print ' (%s): %r' % (pkg_name, test.globs[p2]) @@ -240,8 +240,7 @@ class numpyDoctest(npd.Doctest): numpy.set_printoptions(**print_state) - # Implement a wantFile method so that we can ignore NumPy-specific - # build files that shouldn't be searched for tests + # Ignore NumPy-specific build files that shouldn't be searched for tests def wantFile(self, file): bn = os.path.basename(file) if bn in _doctest_ignore: diff --git a/numpy/testing/nosetester.py b/numpy/testing/nosetester.py index 0c54a8b64..d4a98fa78 100644 --- a/numpy/testing/nosetester.py +++ b/numpy/testing/nosetester.py @@ -236,7 +236,7 @@ class NoseTester(object): from noseclasses import numpyDoctest plugins = [numpyDoctest(), ] for m, p in nose.plugins.builtin.builtins: - mod = __import__(m,fromlist=[p]) + mod = __import__(m,globals(),{},[p]) plug = getattr(mod, p) plugins.append(plug()) -- cgit v1.2.1