We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents f334ffc + 70d307e commit 814a94cCopy full SHA for 814a94c
Lib/test/support/__init__.py
@@ -895,10 +895,12 @@ def temp_dir(path=None, quiet=False):
895
raise
896
warnings.warn('tests may fail, unable to create temp dir: ' + path,
897
RuntimeWarning, stacklevel=3)
898
+ if dir_created:
899
+ pid = os.getpid()
900
try:
901
yield path
902
finally:
- if dir_created:
903
+ if dir_created and pid == os.getpid():
904
shutil.rmtree(path)
905
906
@contextlib.contextmanager
0 commit comments