summaryrefslogtreecommitdiffstats
path: root/Lib/test/script_helper.py
diff options
context:
space:
mode:
authorBrett Cannon <brett@python.org>2012-04-27 17:52:03 (GMT)
committerBrett Cannon <brett@python.org>2012-04-27 17:52:03 (GMT)
commitc8287efed3c493330ee112c397668ec3edcd7380 (patch)
tree8c91898f97412eec2dd7ccb8dc9d80eb2b0ef398 /Lib/test/script_helper.py
parentcfc1cc2996fd513aa96ff27060c36f3b5ea9dab5 (diff)
downloadcpython-c8287efed3c493330ee112c397668ec3edcd7380.zip
cpython-c8287efed3c493330ee112c397668ec3edcd7380.tar.gz
cpython-c8287efed3c493330ee112c397668ec3edcd7380.tar.bz2
Invalidate finder caches after creating a new script.
Diffstat (limited to 'Lib/test/script_helper.py')
-rw-r--r--Lib/test/script_helper.py2
1 files changed, 2 insertions, 0 deletions
diff --git a/Lib/test/script_helper.py b/Lib/test/script_helper.py
index 10ada6d..b09f4bf 100644
--- a/Lib/test/script_helper.py
+++ b/Lib/test/script_helper.py
@@ -1,6 +1,7 @@
# Common utility functions used by various script execution tests
# e.g. test_cmd_line, test_cmd_line_script and test_runpy
+import importlib
import sys
import os
import os.path
@@ -93,6 +94,7 @@ def make_script(script_dir, script_basename, source):
script_file = open(script_name, 'w', encoding='utf-8')
script_file.write(source)
script_file.close()
+ importlib.invalidate_caches()
return script_name
def make_zip_script(zip_dir, zip_basename, script_name, name_in_zip=None):