]> granicus.if.org Git - python/commitdiff
#11030: make --coverdir work for relative directories again.
authorR David Murray <rdmurray@bitdance.com>
Thu, 24 Mar 2011 18:35:30 +0000 (14:35 -0400)
committerR David Murray <rdmurray@bitdance.com>
Thu, 24 Mar 2011 18:35:30 +0000 (14:35 -0400)
Lib/test/regrtest.py

index 63268e5cbbd35a7ab1fc9157fb2b878a4433c4cd..18c86f7135d3a2dc74888e4331e154e0fb3076cd 100755 (executable)
@@ -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'):