The usual.
diff --git a/Lib/dos-8x3/sre_pars.py b/Lib/dos-8x3/sre_pars.py
index f4741c9..7c36d4f 100644
--- a/Lib/dos-8x3/sre_pars.py
+++ b/Lib/dos-8x3/sre_pars.py
@@ -12,8 +12,6 @@
from sre_constants import *
-MAXREPEAT = 65535
-
SPECIAL_CHARS = ".\\[{()*+?^$|"
REPEAT_CHARS = "*+?{"
@@ -393,6 +391,8 @@
# potential range
this = source.get()
if this == "]":
+ if code1[0] is IN:
+ code1 = code1[1][0]
set.append(code1)
set.append((LITERAL, ord("-")))
break
@@ -593,6 +593,11 @@
# p.dump()
+ if not (flags & SRE_FLAG_VERBOSE) and p.pattern.flags & SRE_FLAG_VERBOSE:
+ # the VERBOSE flag was switched on inside the pattern. to be
+ # on the safe side, we'll parse the whole thing again...
+ return parse(str, p.pattern.flags)
+
return p
def parse_template(source, pattern):