Skip to content
This repository was archived by the owner on Feb 13, 2025. It is now read-only.

Commit ca52f72

Browse files
author
Anselm Kruis
committed
Issue #112: Prepare Stackless 3.5, fix a C-Python test suite bug
This commit merges the fix from C-Python pull request python#1066 (git commit 22e032a) for bpo-30028. Without this change $ ./python -m test.regrtest test_multiprocessing_fork fails. ($ ./python -m test.test_multiprocessing_fork is OK.) https://bitbucket.org/stackless-dev/stackless/issues/112 (grafted from bda8a9d487da7cfbe4357d5c4c7635e0de19c6af)
1 parent ba5cf46 commit ca52f72

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

Lib/test/support/__init__.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -902,10 +902,12 @@ def temp_dir(path=None, quiet=False):
902902
raise
903903
warnings.warn('tests may fail, unable to create temp dir: ' + path,
904904
RuntimeWarning, stacklevel=3)
905+
if dir_created:
906+
pid = os.getpid()
905907
try:
906908
yield path
907909
finally:
908-
if dir_created:
910+
if dir_created and pid == os.getpid():
909911
shutil.rmtree(path)
910912

911913
@contextlib.contextmanager

0 commit comments

Comments
 (0)