#11030: make --coverdir work for relative directories again.
diff --git a/Lib/test/regrtest.py b/Lib/test/regrtest.py
index 63268e5..18c86f7 100755
--- 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'):