From 03504fc2fbb7aab41560e761c8ed8e24b4ec6ebe Mon Sep 17 00:00:00 2001 From: R David Murray Date: Thu, 24 Mar 2011 14:35:30 -0400 Subject: [PATCH] #11030: make --coverdir work for relative directories again. --- Lib/test/regrtest.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/Lib/test/regrtest.py b/Lib/test/regrtest.py index 63268e5cbbd..18c86f7135d 100755 --- a/Lib/test/regrtest.py +++ b/Lib/test/regrtest.py @@ -315,7 +315,9 @@ def main(tests=None, testdir=None, verbose=0, quiet=False, elif o in ('-T', '--coverage'): trace = True elif o in ('-D', '--coverdir'): - coverdir = os.path.join(os.getcwd(), a) + # CWD is replaced with a temporary dir before calling main(), so we + # need join it with the saved CWD so it goes where the user expects. + coverdir = os.path.join(support.SAVEDCWD, a) elif o in ('-N', '--nocoverdir'): coverdir = None elif o in ('-R', '--huntrleaks'):