[Python-checkins] python/dist/src/Lib/test test_traceback.py, 1.8, 1.9

tim_one at users.sourceforge.net tim_one at users.sourceforge.net
Wed Oct 27 04:33:18 CEST 2004


Update of /cvsroot/python/python/dist/src/Lib/test
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv15020/Lib/test

Modified Files:
	test_traceback.py 
Log Message:
Paper over bug 1054615 by passing sane values to os.utime().

The underlying bug still exists, but also existed in 2.3.4:
import.c's load_source_module() returns NULL if
PyOS_GetLastModificationTime() returns -1, but
PyOS_GetLastModificationTime() doesn't set any exception when it returns
-1, and neither does load_source_module() when it gets back -1.  This
leads to "SystemError: NULL result without error in PyObject_Call"
on an import that fails in this way.


Index: test_traceback.py
===================================================================
RCS file: /cvsroot/python/python/dist/src/Lib/test/test_traceback.py,v
retrieving revision 1.8
retrieving revision 1.9
diff -u -d -r1.8 -r1.9
--- test_traceback.py	26 Oct 2004 09:16:41 -0000	1.8
+++ test_traceback.py	27 Oct 2004 02:33:15 -0000	1.9
@@ -41,7 +41,8 @@
         self.assert_(err[1].strip() == "[x for x in x] = x")
 
     def test_bug737473(self):
-        import sys, os, tempfile
+        import sys, os, tempfile, time
+
         savedpath = sys.path[:]
         testdir = tempfile.mkdtemp()
         try:
@@ -51,8 +52,10 @@
 def test():
     raise ValueError"""
 
+            # XXX Unclear why we're doing this next bit.
             if hasattr(os, 'utime'):
-                os.utime(testfile, (0, 0))
+                past = time.time() - 3
+                os.utime(testfile, (past, past))
             else:
                 import time
                 time.sleep(3) # not to stay in same mtime.



More information about the Python-checkins mailing list