summaryrefslogtreecommitdiff
path: root/coverage/files.py
diff options
context:
space:
mode:
authorNed Batchelder <ned@nedbatchelder.com>2019-11-25 15:43:44 -0500
committerNed Batchelder <ned@nedbatchelder.com>2019-11-25 15:54:39 -0500
commita28e873891003ad31762e1214d32f54ec423fd62 (patch)
treee9af8c2f06a415795279ccf568a19ff9a669e6a5 /coverage/files.py
parent69dbdcece78118d14aa45cacbe0d22eae494e99e (diff)
downloadpython-coveragepy-git-a28e873891003ad31762e1214d32f54ec423fd62.tar.gz
Adapt to 3.9's way of reporting files using absolute paths.
Diffstat (limited to 'coverage/files.py')
-rw-r--r--coverage/files.py7
1 files changed, 7 insertions, 0 deletions
diff --git a/coverage/files.py b/coverage/files.py
index dc8c248f..2836d4e5 100644
--- a/coverage/files.py
+++ b/coverage/files.py
@@ -172,6 +172,13 @@ def abs_file(filename):
return path
+def python_reported_file(filename):
+ """Return the string as Python would describe this file name."""
+ if env.PYBEHAVIOR.report_absolute_files:
+ filename = os.path.abspath(filename)
+ return filename
+
+
RELATIVE_DIR = None
CANONICAL_FILENAME_CACHE = None
set_relative_directory()