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
c9c8d0ed
Commit
c9c8d0ed
authored
Mar 06, 2011
by
Benjamin Peterson
Browse files
Options
Browse Files
Download
Plain Diff
merge 3.1
parents
63bd5f9f
d86e4c86
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
4 deletions
+7
-4
Lib/lib2to3/pytree.py
Lib/lib2to3/pytree.py
+7
-4
No files found.
Lib/lib2to3/pytree.py
View file @
c9c8d0ed
...
...
@@ -743,9 +743,11 @@ class WildcardPattern(BasePattern):
else
:
# The reason for this is that hitting the recursion limit usually
# results in some ugly messages about how RuntimeErrors are being
# ignored.
save_stderr
=
sys
.
stderr
sys
.
stderr
=
StringIO
()
# ignored. We only have to do this on CPython, though, because other
# implementations don't have this nasty bug in the first place.
if
hasattr
(
sys
,
"getrefcount"
):
save_stderr
=
sys
.
stderr
sys
.
stderr
=
StringIO
()
try
:
for
count
,
r
in
self
.
_recursive_matches
(
nodes
,
0
):
if
self
.
name
:
...
...
@@ -759,7 +761,8 @@ class WildcardPattern(BasePattern):
r
[
self
.
name
]
=
nodes
[:
count
]
yield
count
,
r
finally
:
sys
.
stderr
=
save_stderr
if
hasattr
(
sys
,
"getrefcount"
):
sys
.
stderr
=
save_stderr
def
_iterative_matches
(
self
,
nodes
):
"""Helper to iteratively yield the matches."""
...
...
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