diff options
author | Raymond Hettinger <python@rcn.com> | 2007-12-19 18:13:31 +0000 |
---|---|---|
committer | Raymond Hettinger <python@rcn.com> | 2007-12-19 18:13:31 +0000 |
commit | 80016c95554677cd172610501446b096edfb267c (patch) | |
tree | 114f9f7ea92a5a63e2b1d40b30354f1962558ea4 /Lib/re.py | |
parent | 0f5e7bf3049408d6f4c1855807204c9f13ae98f9 (diff) | |
download | cpython-git-80016c95554677cd172610501446b096edfb267c.tar.gz |
Fix issue 1661: Flags argument silently ignored in re functions with compiled regexes.
Diffstat (limited to 'Lib/re.py')
-rw-r--r-- | Lib/re.py | 2 |
1 files changed, 2 insertions, 0 deletions
@@ -224,6 +224,8 @@ def _compile(*key): 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" |