[Python-checkins] cpython: #11030: make --coverdir work for relative directories again.

r.david.murray python-checkins at python.org
Thu Mar 24 19:35:46 CET 2011


http://hg.python.org/cpython/rev/6ff4e479f03b
changeset:   68903:6ff4e479f03b
user:        R David Murray <rdmurray at bitdance.com>
date:        Thu Mar 24 14:35:30 2011 -0400
summary:
  #11030: make --coverdir work for relative directories again.

files:
  Lib/test/regrtest.py |  4 +++-
  1 files changed, 3 insertions(+), 1 deletions(-)


diff --git a/Lib/test/regrtest.py b/Lib/test/regrtest.py
--- a/Lib/test/regrtest.py
+++ b/Lib/test/regrtest.py
@@ -315,7 +315,9 @@
         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'):

-- 
Repository URL: http://hg.python.org/cpython


More information about the Python-checkins mailing list