Raise statement normalization in Lib/.
diff --git a/Lib/sre_compile.py b/Lib/sre_compile.py
index 3c9035f..505af92 100644
--- a/Lib/sre_compile.py
+++ b/Lib/sre_compile.py
@@ -69,7 +69,7 @@
emit(OPCODES[ANY])
elif op in REPEATING_CODES:
if flags & SRE_FLAG_TEMPLATE:
- raise error, "internal: unsupported template operator"
+ raise error("internal: unsupported template operator")
emit(OPCODES[REPEAT])
skip = _len(code); emit(0)
emit(av[0])
@@ -118,7 +118,7 @@
else:
lo, hi = av[1].getwidth()
if lo != hi:
- raise error, "look-behind requires fixed-width pattern"
+ raise error("look-behind requires fixed-width pattern")
emit(lo) # look behind
_compile(code, av[1], flags)
emit(OPCODES[SUCCESS])
@@ -179,7 +179,7 @@
else:
code[skipyes] = _len(code) - skipyes + 1
else:
- raise ValueError, ("unsupported operand type", op)
+ raise ValueError("unsupported operand type", op)
def _compile_charset(charset, flags, code, fixup=None):
# compile charset subprogram
@@ -207,7 +207,7 @@
else:
emit(CHCODES[av])
else:
- raise error, "internal: unsupported set operator"
+ raise error("internal: unsupported set operator")
emit(OPCODES[FAILURE])
def _optimize_charset(charset, fixup):
@@ -362,7 +362,7 @@
# check if av is a "simple" operator
lo, hi = av[2].getwidth()
if lo == 0 and hi == MAXREPEAT:
- raise error, "nothing to repeat"
+ raise error("nothing to repeat")
return lo == hi == 1 and av[2][0][0] != SUBPATTERN
def _compile_info(code, pattern, flags):