summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--Lib/sre_parse.py2
-rwxr-xr-xLib/test/re_tests.py2
2 files changed, 4 insertions, 0 deletions
diff --git a/Lib/sre_parse.py b/Lib/sre_parse.py
index fcf5bcc..9cbbc02 100644
--- a/Lib/sre_parse.py
+++ b/Lib/sre_parse.py
@@ -393,6 +393,8 @@ def _parse(source, state):
# potential range
this = source.get()
if this == "]":
+ if code1[0] is IN:
+ code1 = code1[1][0]
set.append(code1)
set.append((LITERAL, ord("-")))
break
diff --git a/Lib/test/re_tests.py b/Lib/test/re_tests.py
index 8675224..7c54175 100755
--- a/Lib/test/re_tests.py
+++ b/Lib/test/re_tests.py
@@ -619,4 +619,6 @@ xyzabc
(r' (?x)foo ', 'foo', SUCCEED, 'found', 'foo'),
# bug 115618: negative lookahead
(r'(?<!abc)(d.f)', 'abcdefdof', SUCCEED, 'found', 'dof'),
+ # bug 116251: character class bug
+ (r'[\w-]+', 'laser_beam', SUCCEED, 'found', 'laser_beam'),
]