Skip to content

Commit

Permalink
Merge branch 3.5-slp into master-slp (issue python#112 test suite fix)
Browse files Browse the repository at this point in the history
  • Loading branch information
Anselm Kruis committed Oct 5, 2017
2 parents f334ffc + 70d307e commit 814a94c
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion Lib/test/support/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -895,10 +895,12 @@ def temp_dir(path=None, quiet=False):
raise
warnings.warn('tests may fail, unable to create temp dir: ' + path,
RuntimeWarning, stacklevel=3)
if dir_created:
pid = os.getpid()
try:
yield path
finally:
if dir_created:
if dir_created and pid == os.getpid():
shutil.rmtree(path)

@contextlib.contextmanager
Expand Down

0 comments on commit 814a94c

Please sign in to comment.