From 92d02ded76ebc769dd555e5e3db6f932b8b60a83 Mon Sep 17 00:00:00 2001 From: Ned Batchelder Date: Sun, 27 Nov 2016 08:43:14 -0500 Subject: Avoid flags in regexes we combine These regexes get piped together with other regexes, and flags not at the beginning of the regex raise DeprecationWarnings. Also, I'm not sure what the flag will do when combined with the other regexes. Also also, do people really use upper-case pragmas? --- coverage/config.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'coverage') diff --git a/coverage/config.py b/coverage/config.py index 6750b79..ad3efa9 100644 --- a/coverage/config.py +++ b/coverage/config.py @@ -122,12 +122,12 @@ class HandyConfigParser(configparser.RawConfigParser): # The default line exclusion regexes. DEFAULT_EXCLUDE = [ - r'(?i)#\s*pragma[:\s]?\s*no\s*cover', + r'#\s*(pragma|PRAGMA)[:\s]?\s*(no|NO)\s*(cover|COVER)', ] # The default partial branch regexes, to be modified by the user. DEFAULT_PARTIAL = [ - r'(?i)#\s*pragma[:\s]?\s*no\s*branch', + r'#\s*(pragma|PRAGMA)[:\s]?\s*(no|NO)\s*(branch|BRANCH)', ] # The default partial branch regexes, based on Python semantics. -- cgit v1.2.1