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

Commit 70d307e

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
1 parent 75023cf commit 70d307e

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
@@ -895,10 +895,12 @@ def temp_dir(path=None, quiet=False):
895895
raise
896896
warnings.warn('tests may fail, unable to create temp dir: ' + path,
897897
RuntimeWarning, stacklevel=3)
898+
if dir_created:
899+
pid = os.getpid()
898900
try:
899901
yield path
900902
finally:
901-
if dir_created:
903+
if dir_created and pid == os.getpid():
902904
shutil.rmtree(path)
903905

904906
@contextlib.contextmanager

0 commit comments

Comments
 (0)