diff options
Diffstat (limited to 'Lib/test/regrtest.py')
-rwxr-xr-x | Lib/test/regrtest.py | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/Lib/test/regrtest.py b/Lib/test/regrtest.py index 89acb9b..e2e3765 100755 --- a/Lib/test/regrtest.py +++ b/Lib/test/regrtest.py @@ -162,6 +162,7 @@ import re import io import sys import time +import errno import traceback import warnings import unittest @@ -1511,8 +1512,11 @@ def _make_temp_dir_for_build(TEMPDIR): if sysconfig.is_python_build(): TEMPDIR = os.path.join(sysconfig.get_config_var('srcdir'), 'build') TEMPDIR = os.path.abspath(TEMPDIR) - if not os.path.exists(TEMPDIR): + try: os.mkdir(TEMPDIR) + except OSError as e: + if e.errno != errno.EEXIST: + raise # Define a writable temp dir that will be used as cwd while running # the tests. The name of the dir includes the pid to allow parallel |