From b90e592e26da67372cb633150c49372799dc51bf Mon Sep 17 00:00:00 2001 From: Ned Batchelder Date: Sun, 18 Jan 2015 13:25:49 -0500 Subject: Collect all the nudgy environment checks into coverage.env --- coverage/files.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'coverage/files.py') 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. -- cgit v1.2.1