]> granicus.if.org Git - python/commitdiff
Pass optional arguments (globals(), locals(), []) to __import__() so
authorGuido van Rossum <guido@python.org>
Sun, 7 Sep 1997 16:42:34 +0000 (16:42 +0000)
committerGuido van Rossum <guido@python.org>
Sun, 7 Sep 1997 16:42:34 +0000 (16:42 +0000)
it will run as package test, e.g. this will run the test suite:

    import test.regrtest
    test.regrtest.main()

Lib/test/regrtest.py

index ce5e22d97a5ab7be4039c6d0f75bf60ce251af0a..7e1003c70b92d2995b5ea8d024085da62bb643a5 100755 (executable)
@@ -133,7 +133,7 @@ def runtest(test, generate, verbose):
            if cfp:
                sys.stdout = cfp
                print test              # Output file starts with test name
-           __import__(test)
+           __import__(test, globals(), locals(), [])
        finally:
            sys.stdout = save_stdout
     except ImportError, msg: