commit | 80016c95554677cd172610501446b096edfb267c | [log] [tgz] |
---|---|---|
author | Raymond Hettinger <python@rcn.com> | Wed Dec 19 18:13:31 2007 +0000 |
committer | Raymond Hettinger <python@rcn.com> | Wed Dec 19 18:13:31 2007 +0000 |
tree | 114f9f7ea92a5a63e2b1d40b30354f1962558ea4 | |
parent | 0f5e7bf3049408d6f4c1855807204c9f13ae98f9 [diff] [blame] |
Fix issue 1661: Flags argument silently ignored in re functions with compiled regexes.
diff --git a/Lib/re.py b/Lib/re.py index a33e34e..39e81fd 100644 --- a/Lib/re.py +++ b/Lib/re.py
@@ -224,6 +224,8 @@ return p pattern, flags = key if isinstance(pattern, _pattern_type): + if flags: + raise ValueError('Cannot process flags argument with a compiled pattern') return pattern if not sre_compile.isstring(pattern): raise TypeError, "first argument must be string or compiled pattern"