[pypy-commit] pypy default: fix some app_main tests when time isn't built-in to the host python

bdkearns noreply at buildbot.pypy.org
Thu Feb 7 21:41:01 CET 2013


Author: Brian Kearns <bdkearns at gmail.com>
Branch: 
Changeset: r60939:c113eeb0f55b
Date: 2013-02-07 15:40 -0500
http://bitbucket.org/pypy/pypy/changeset/c113eeb0f55b/

Log:	fix some app_main tests when time isn't built-in to the host python

diff --git a/pypy/interpreter/app_main.py b/pypy/interpreter/app_main.py
--- a/pypy/interpreter/app_main.py
+++ b/pypy/interpreter/app_main.py
@@ -719,7 +719,7 @@
         root = dn(dn(dn(thisfile)))
         return [join(root, 'lib-python', '2.7'),
                 join(root, 'lib_pypy')]
-    
+
     def pypy_resolvedirof(s):
         # we ignore the issue of symlinks; for tests, the executable is always
         # interpreter/app_main.py anyway
@@ -759,6 +759,10 @@
     del os # make sure that os is not available globally, because this is what
            # happens in "real life" outside the tests
 
+    if 'time' not in sys.builtin_module_names:
+        # make some tests happy by loading this before we clobber sys.path
+        import time; del time
+
     # no one should change to which lists sys.argv and sys.path are bound
     old_argv = sys.argv
     old_path = sys.path


More information about the pypy-commit mailing list