[Python-checkins] r73906 - python/trunk/Lib/test/test_import.py

r.david.murray python-checkins at python.org
Thu Jul 9 17:35:33 CEST 2009


Author: r.david.murray
Date: Thu Jul  9 17:35:33 2009
New Revision: 73906

Log:
Curdir needs to be in the path for the test to work on all buildbots.
(I copied this from another import test, but currently this will fail if
TESTFN ends up in /tmp...see issue 2609).



Modified:
   python/trunk/Lib/test/test_import.py

Modified: python/trunk/Lib/test/test_import.py
==============================================================================
--- python/trunk/Lib/test/test_import.py	(original)
+++ python/trunk/Lib/test/test_import.py	Thu Jul  9 17:35:33 2009
@@ -98,6 +98,7 @@
         # Issue 6070: under posix .pyc files got their execute bit set if
         # the .py file had the execute bit set, but they aren't executable.
         oldmask = os.umask(022)
+        sys.path.insert(0, os.curdir)
         try:
             fname = TESTFN + os.extsep + "py"
             f = open(fname, 'w').close()
@@ -116,6 +117,7 @@
             os.umask(oldmask)
             remove_files(TESTFN)
             if TESTFN in sys.modules: del sys.modules[TESTFN]
+            del sys.path[0]
 
     def testImpModule(self):
         # Verify that the imp module can correctly load and find .py files


More information about the Python-checkins mailing list