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 | b90e592e26da67372cb633150c49372799dc51bf (patch) | |
tree | d822e639649bd73b4c41d1d82a64bf457c477535 /coverage/files.py | |
parent | 9298cc26cae698bd7e7ab0c0e0a8d0931d77f7e2 (diff) | |
download | python-coveragepy-b90e592e26da67372cb633150c49372799dc51bf.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 15ccabc..f7fc969 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. |