From: Antoine Pitrou Date: Mon, 15 Nov 2010 18:25:24 +0000 (+0000) Subject: Hack to avoid test_tempfile failures when run after test_threaded_import X-Git-Tag: v3.1.3~65 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=069488d2795a28a939b1f94153c90f19e3888226;p=thirdparty%2FPython%2Fcpython.git Hack to avoid test_tempfile failures when run after test_threaded_import (only needed on 3.1) --- diff --git a/Lib/test/test_threaded_import.py b/Lib/test/test_threaded_import.py index 7791935fdf17..e4d1882eae50 100644 --- a/Lib/test/test_threaded_import.py +++ b/Lib/test/test_threaded_import.py @@ -10,6 +10,10 @@ import imp 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')