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
6f7c3431
Commit
6f7c3431
authored
Jun 27, 2002
by
Fredrik Lundh
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix bug #570057: Broken pre.subn() (and pre.sub())
This should be backported to the 2.2.X series (how do I do that?)
parent
1add023b
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
2 deletions
+4
-2
Lib/pre.py
Lib/pre.py
+4
-2
No files found.
Lib/pre.py
View file @
6f7c3431
...
...
@@ -367,10 +367,12 @@ class RegexObject:
end
=
len
(
source
)
if
type
(
repl
)
is
type
(
''
):
# See if repl contains group references
# See if repl contains group references (if it does,
# pcre_expand will attempt to call _Dummy.group, which
# results in a TypeError)
try
:
repl
=
pcre_expand
(
_Dummy
,
repl
)
except
error
:
except
(
error
,
TypeError
)
:
m
=
MatchObject
(
self
,
source
,
0
,
end
,
[])
repl
=
lambda
m
,
repl
=
repl
,
expand
=
pcre_expand
:
expand
(
m
,
repl
)
else
:
...
...
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