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
1654d74e
Commit
1654d74e
authored
Sep 25, 2012
by
Benjamin Peterson
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
switch assertion to an explicit ValueError
parent
a820c7ca
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
3 additions
and
3 deletions
+3
-3
Lib/lib2to3/fixer_util.py
Lib/lib2to3/fixer_util.py
+2
-2
Lib/lib2to3/refactor.py
Lib/lib2to3/refactor.py
+1
-1
No files found.
Lib/lib2to3/fixer_util.py
View file @
1654d74e
...
...
@@ -274,9 +274,9 @@ def find_root(node):
"""Find the top level namespace."""
# Scamper up to the top level namespace
while
node
.
type
!=
syms
.
file_input
:
assert
node
.
parent
,
"Tree is insane! root found before "
\
"file_input node was found."
node
=
node
.
parent
if
not
node
:
raise
ValueError
(
"root found before file_input node was found."
)
return
node
def
does_tree_import
(
package
,
name
,
node
):
...
...
Lib/lib2to3/refactor.py
View file @
1654d74e
...
...
@@ -445,7 +445,7 @@ class RefactoringTool(object):
try
:
find_root
(
node
)
except
Assertion
Error
:
except
Value
Error
:
# this node has been cut off from a
# previous transformation ; skip
continue
...
...
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