From: Brett Cannon Date: Fri, 27 Apr 2012 17:52:03 +0000 (-0400) Subject: Invalidate finder caches after creating a new script. X-Git-Tag: v3.3.0a3~67 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=c8287efed3c493330ee112c397668ec3edcd7380;p=python Invalidate finder caches after creating a new script. --- diff --git a/Lib/test/script_helper.py b/Lib/test/script_helper.py index 10ada6d0d1..b09f4bf49e 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):