From: R David Murray Date: Thu, 24 Mar 2011 18:35:30 +0000 (-0400) Subject: #11030: make --coverdir work for relative directories again. X-Git-Tag: v3.3.0a1~2765^2~2 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=03504fc2fbb7aab41560e761c8ed8e24b4ec6ebe;p=thirdparty%2FPython%2Fcpython.git #11030: make --coverdir work for relative directories again. --- diff --git a/Lib/test/regrtest.py b/Lib/test/regrtest.py index 63268e5cbbd3..18c86f7135d3 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'):