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
5c9aad60
Commit
5c9aad60
authored
Apr 12, 2001
by
Jeremy Hylton
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Only treat an AugAssign as def if its the target is a Name.
Fixes last bug found with test_scope.py.
parent
3f76b7e6
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
8 additions
and
4 deletions
+8
-4
Lib/compiler/symbols.py
Lib/compiler/symbols.py
+4
-2
Tools/compiler/compiler/symbols.py
Tools/compiler/compiler/symbols.py
+4
-2
No files found.
Lib/compiler/symbols.py
View file @
5c9aad60
...
...
@@ -299,9 +299,11 @@ class SymbolVisitor:
scope
.
add_def
(
node
.
name
)
def
visitAugAssign
(
self
,
node
,
scope
):
# basically, the node is referenced and defined by the same expr
# If the LHS is a name, then this counts as assignment.
# Otherwise, it's just use.
self
.
visit
(
node
.
node
,
scope
)
self
.
visit
(
node
.
node
,
scope
,
1
)
if
isinstance
(
node
.
node
,
ast
.
Name
):
self
.
visit
(
node
.
node
,
scope
,
1
)
# XXX worry about this
self
.
visit
(
node
.
expr
,
scope
)
def
visitAssign
(
self
,
node
,
scope
):
...
...
Tools/compiler/compiler/symbols.py
View file @
5c9aad60
...
...
@@ -299,9 +299,11 @@ class SymbolVisitor:
scope
.
add_def
(
node
.
name
)
def
visitAugAssign
(
self
,
node
,
scope
):
# basically, the node is referenced and defined by the same expr
# If the LHS is a name, then this counts as assignment.
# Otherwise, it's just use.
self
.
visit
(
node
.
node
,
scope
)
self
.
visit
(
node
.
node
,
scope
,
1
)
if
isinstance
(
node
.
node
,
ast
.
Name
):
self
.
visit
(
node
.
node
,
scope
,
1
)
# XXX worry about this
self
.
visit
(
node
.
expr
,
scope
)
def
visitAssign
(
self
,
node
,
scope
):
...
...
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