[Python-checkins] r84776 - in python/branches/py3k: Lib/test/regrtest.py Misc/NEWS

florent.xicluna python-checkins at python.org
Mon Sep 13 18:35:02 CEST 2010


Author: florent.xicluna
Date: Mon Sep 13 18:35:02 2010
New Revision: 84776

Log:
Make test.regrtest.__file__ absolute, this was not always the case when running profile or trace, for example.  (issue #9323)

Modified:
   python/branches/py3k/Lib/test/regrtest.py
   python/branches/py3k/Misc/NEWS

Modified: python/branches/py3k/Lib/test/regrtest.py
==============================================================================
--- python/branches/py3k/Lib/test/regrtest.py	(original)
+++ python/branches/py3k/Lib/test/regrtest.py	Mon Sep 13 18:35:02 2010
@@ -1458,7 +1458,13 @@
         return self.expected
 
 if __name__ == '__main__':
-    # Simplification for findtestdir().
+    # findtestdir() gets the dirname out of __file__, so we have to make it
+    # absolute before changing the working directory.
+    # For example __file__ may be relative when running trace or profile.
+    # See issue #9323.
+    __file__ = os.path.abspath(__file__)
+
+    # sanity check
     assert __file__ == os.path.abspath(sys.argv[0])
 
     # When tests are run from the Python build directory, it is best practice

Modified: python/branches/py3k/Misc/NEWS
==============================================================================
--- python/branches/py3k/Misc/NEWS	(original)
+++ python/branches/py3k/Misc/NEWS	Mon Sep 13 18:35:02 2010
@@ -142,6 +142,12 @@
   as wide (UCS4) unicode builds for both the host interpreter (embedded
   inside gdb) and the interpreter under test.
 
+Tests
+-----
+
+- Issue #9323: Make test.regrtest.__file__ absolute, this was not always the
+  case when running profile or trace, for example.
+
 Build
 -----
 


More information about the Python-checkins mailing list