[Python-checkins] r86474 - python/branches/release31-maint/Lib/test/test_threaded_import.py

antoine.pitrou python-checkins at python.org
Mon Nov 15 19:25:30 CET 2010


Author: antoine.pitrou
Date: Mon Nov 15 19:25:24 2010
New Revision: 86474

Log:
Hack to avoid test_tempfile failures when run after test_threaded_import
(only needed on 3.1)



Modified:
   python/branches/release31-maint/Lib/test/test_threaded_import.py

Modified: python/branches/release31-maint/Lib/test/test_threaded_import.py
==============================================================================
--- python/branches/release31-maint/Lib/test/test_threaded_import.py	(original)
+++ python/branches/release31-maint/Lib/test/test_threaded_import.py	Mon Nov 15 19:25:24 2010
@@ -10,6 +10,10 @@
 import sys
 import time
 import shutil
+# HACK: preloading tempfile is necessary to avoid failures when test_tempfile
+# is run after test_threaded_import.  This has to do with dark secrets of
+# the import machinery and phantom copies of the random module.
+import tempfile
 import unittest
 from test.support import verbose, import_module, run_unittest, TESTFN
 thread = import_module('_thread')


More information about the Python-checkins mailing list