diff -r 96f08a22f562 Lib/test/regrtest.py --- a/Lib/test/regrtest.py Sat Feb 23 22:21:48 2013 -0500 +++ b/Lib/test/regrtest.py Sun Feb 24 14:24:53 2013 +0100 @@ -1555,13 +1555,9 @@ except FileExistsError: pass - # 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 - # testing (see the -j option). - TESTCWD = 'test_python_{}'.format(os.getpid()) + TESTCWD = os.path.join(TEMPDIR, 'test') + return TEMPDIR, TESTCWD - TESTCWD = os.path.join(TEMPDIR, TESTCWD) - return TEMPDIR, TESTCWD if __name__ == '__main__': # Remove regrtest.py's own directory from the module search path. Despite diff -r 96f08a22f562 Lib/test/support.py --- a/Lib/test/support.py Sat Feb 23 22:21:48 2013 -0500 +++ b/Lib/test/support.py Sun Feb 24 14:24:53 2013 +0100 @@ -750,6 +750,8 @@ try: os.mkdir(name) is_temporary = True + except FileExistsError: + is_temporary = False except OSError: if not quiet: raise