Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
cython
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
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Gwenaël Samain
cython
Commits
45dea6aa
Commit
45dea6aa
authored
Sep 19, 2011
by
Vitja Makarov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Visit lhs if not name and not sequence, fix #739
parent
4236478d
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
18 additions
and
6 deletions
+18
-6
Cython/Compiler/FlowControl.py
Cython/Compiler/FlowControl.py
+1
-6
tests/errors/uninitialized_lhs.pyx
tests/errors/uninitialized_lhs.pyx
+17
-0
No files found.
Cython/Compiler/FlowControl.py
View file @
45dea6aa
...
...
@@ -638,10 +638,6 @@ class CreateControlFlowGraph(CythonTransform):
self
.
flow
.
block
.
add_child
(
exc_descr
.
entry_point
)
self
.
flow
.
nextblock
()
if
isinstance
(
lhs
,
(
ExprNodes
.
AttributeNode
,
ExprNodes
.
IndexNode
)):
self
.
visit
(
lhs
)
return
if
not
rhs
:
rhs
=
object_expr
if
lhs
.
is_name
:
...
...
@@ -656,8 +652,7 @@ class CreateControlFlowGraph(CythonTransform):
for
arg
in
lhs
.
args
:
self
.
mark_assignment
(
arg
)
else
:
# Could use this info to infer cdef class attributes...
pass
self
.
visit
(
lhs
)
if
self
.
flow
.
exceptions
:
exc_descr
=
self
.
flow
.
exceptions
[
-
1
]
...
...
tests/errors/uninitialized_lhs.pyx
0 → 100644
View file @
45dea6aa
# cython: warn.maybe_uninitialized=True
# mode: error
# tag: werror
# ticket: 739
def
index_lhs
(
a
):
cdef
object
idx
a
[
idx
]
=
1
def
slice_lhs
(
a
):
cdef
object
idx
a
[:
idx
]
=
1
_ERRORS
=
"""
7:9: local variable 'idx' referenced before assignment
11:10: local variable 'idx' referenced before assignment
"""
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