Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
cpython
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
cpython
Commits
f595a127
Commit
f595a127
authored
Jun 22, 2014
by
Raymond Hettinger
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Issue #8343: Named group error msgs did not show the group name.
parent
3bef9355
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
9 additions
and
3 deletions
+9
-3
Lib/sre_parse.py
Lib/sre_parse.py
+6
-3
Misc/NEWS
Misc/NEWS
+3
-0
No files found.
Lib/sre_parse.py
View file @
f595a127
...
...
@@ -567,7 +567,8 @@ def _parse(source, state):
"%r"
%
name
)
gid
=
state
.
groupdict
.
get
(
name
)
if
gid
is
None
:
raise
error
,
"unknown group name"
msg
=
"unknown group name: {0!r}"
.
format
(
name
)
raise
error
(
msg
)
subpatternappend
((
GROUPREF
,
gid
))
continue
else
:
...
...
@@ -620,7 +621,8 @@ def _parse(source, state):
if
isname
(
condname
):
condgroup
=
state
.
groupdict
.
get
(
condname
)
if
condgroup
is
None
:
raise
error
,
"unknown group name"
msg
=
"unknown group name: {0!r}"
.
format
(
condgroup
)
raise
error
(
msg
)
else
:
try
:
condgroup
=
int
(
condname
)
...
...
@@ -746,7 +748,8 @@ def parse_template(source, pattern):
try
:
index
=
pattern
.
groupindex
[
name
]
except
KeyError
:
raise
IndexError
,
"unknown group name"
msg
=
"unknown group name: {0!r}"
.
format
(
name
)
raise
IndexError
(
msg
)
a
((
MARK
,
index
))
elif
c
==
"0"
:
if
s
.
next
in
OCTDIGITS
:
...
...
Misc/NEWS
View file @
f595a127
...
...
@@ -31,6 +31,9 @@ Library
- Issue #21672: Fix the behavior of ntpath.join on UNC-style paths.
- Issue #8343: Named group error messages in the re module did not show
the name of the erroneous group.
- Issue #21491: SocketServer: Fix a race condition in child processes reaping.
- Issue #21635: The difflib SequenceMatcher.get_matching_blocks() method
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment