mirror of
https://github.com/python/cpython.git
synced 2025-07-19 09:15:34 +00:00
Merge #15415 from 3.3
This commit is contained in:
commit
cf67b2a891
7 changed files with 223 additions and 54 deletions
|
@ -13,7 +13,7 @@ import shutil
|
|||
import zipfile
|
||||
|
||||
from importlib.util 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)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue