diff options
author | Ned Batchelder <ned@nedbatchelder.com> | 2015-01-18 13:25:49 -0500 |
---|---|---|
committer | Ned Batchelder <ned@nedbatchelder.com> | 2015-01-18 13:25:49 -0500 |
commit | 8d60d392c5d9b00560c4a9418902f12126dae125 (patch) | |
tree | c6634c5c0b940a32c1fb0afb36b4a928a91f3304 /coverage/files.py | |
parent | 0d0836309b6354a07fb09cd8d28b309b6c8dba6c (diff) | |
download | python-coveragepy-git-8d60d392c5d9b00560c4a9418902f12126dae125.tar.gz |
Collect all the nudgy environment checks into coverage.env
Diffstat (limited to 'coverage/files.py')
-rw-r--r-- | coverage/files.py | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/coverage/files.py b/coverage/files.py index 15ccabce..f7fc9693 100644 --- a/coverage/files.py +++ b/coverage/files.py @@ -8,6 +8,7 @@ import posixpath import re import sys +from coverage import env from coverage.misc import CoverageException, join_regex @@ -54,7 +55,7 @@ class FileLocator(object): return self.canonical_filename_cache[filename] -if sys.platform == 'win32': +if env.WINDOWS: def actual_path(path): """Get the actual path of `path`, including the correct case.""" @@ -188,7 +189,7 @@ class FnmatchMatcher(object): # take care of that ourselves. fnpats = (fnmatch.translate(p) for p in pats) fnpats = (p.replace(r"\/", r"[\\/]") for p in fnpats) - if sys.platform == 'win32': + if env.WINDOWS: # Windows is also case-insensitive. BTW: the regex docs say that # flags like (?i) have to be at the beginning, but fnmatch puts # them at the end, and having two there seems to work fine. |