mirror of
https://github.com/python/cpython.git
synced 2025-09-13 12:17:24 +00:00
Fix an import race condition.
This commit is contained in:
parent
73def61edd
commit
afbdc13c1b
1 changed files with 2 additions and 2 deletions
|
@ -1,7 +1,6 @@
|
||||||
|
|
||||||
import test.support, unittest
|
import test.support, unittest
|
||||||
from test.support import TESTFN, unlink, unload
|
from test.support import TESTFN, unlink, unload
|
||||||
import os, sys
|
import importlib, os, sys
|
||||||
|
|
||||||
class CodingTest(unittest.TestCase):
|
class CodingTest(unittest.TestCase):
|
||||||
def test_bad_coding(self):
|
def test_bad_coding(self):
|
||||||
|
@ -40,6 +39,7 @@ class CodingTest(unittest.TestCase):
|
||||||
f.write("'A very long string %s'\n" % ("X" * 1000))
|
f.write("'A very long string %s'\n" % ("X" * 1000))
|
||||||
f.close()
|
f.close()
|
||||||
|
|
||||||
|
importlib.invalidate_caches()
|
||||||
__import__(TESTFN)
|
__import__(TESTFN)
|
||||||
finally:
|
finally:
|
||||||
f.close()
|
f.close()
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue