summaryrefslogtreecommitdiff
path: root/Lib/test/script_helper.py
diff options
context:
space:
mode:
authorNick Coghlan <ncoghlan@gmail.com>2013-07-28 22:11:50 +1000
committerNick Coghlan <ncoghlan@gmail.com>2013-07-28 22:11:50 +1000
commitb0972b74dfde433d245132524f48edab26dd034d (patch)
treecea144e55300e8e3eb55a84d75067acd9c51e118 /Lib/test/script_helper.py
parent95bea6bc887d6f80775706cbefd5c0afb1aba221 (diff)
downloadcpython-b0972b74dfde433d245132524f48edab26dd034d.tar.gz
Close #15415: Factor out temp dir helpers to test.support
Patch by Chris Jerdonek
Diffstat (limited to 'Lib/test/script_helper.py')
-rw-r--r--Lib/test/script_helper.py12
1 files changed, 1 insertions, 11 deletions
diff --git a/Lib/test/script_helper.py b/Lib/test/script_helper.py
index b09f4bf49e..ab201649e5 100644
--- a/Lib/test/script_helper.py
+++ b/Lib/test/script_helper.py
@@ -13,7 +13,7 @@ import shutil
import zipfile
from imp import source_from_cache
-from test.support import make_legacy_pyc, strip_python_stderr
+from test.support import make_legacy_pyc, strip_python_stderr, temp_dir
# Executing the interpreter in a subprocess
def _assert_python(expected_success, *args, **env_vars):
@@ -77,16 +77,6 @@ def kill_python(p):
subprocess._cleanup()
return data
-# Script creation utilities
-@contextlib.contextmanager
-def temp_dir():
- dirname = tempfile.mkdtemp()
- dirname = os.path.realpath(dirname)
- try:
- yield dirname
- finally:
- shutil.rmtree(dirname)
-
def make_script(script_dir, script_basename, source):
script_filename = script_basename+os.extsep+'py'
script_name = os.path.join(script_dir, script_filename)