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
b3048e1a
Commit
b3048e1a
authored
Apr 20, 2012
by
Stefan Behnel
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
check for None during optimised indexing into list/tuple, unify exception message
parent
5aac8caf
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
2 deletions
+3
-2
Cython/Compiler/ExprNodes.py
Cython/Compiler/ExprNodes.py
+3
-2
No files found.
Cython/Compiler/ExprNodes.py
View file @
b3048e1a
...
...
@@ -2685,8 +2685,9 @@ class IndexNode(ExprNode):
elif
is_slice
and
base_type
in
(
bytes_type
,
str_type
,
unicode_type
,
list_type
,
tuple_type
):
self
.
type
=
base_type
else
:
if
base_type
is
dict_type
:
self
.
base
=
self
.
base
.
as_none_safe_node
(
"'NoneType' object is unsubscriptable"
)
if
base_type
in
(
list_type
,
tuple_type
,
dict_type
):
# do the None check explicitly (not in a helper) to allow optimising it away
self
.
base
=
self
.
base
.
as_none_safe_node
(
"'NoneType' object is not subscriptable"
)
self
.
type
=
py_object_type
else
:
if
base_type
.
is_ptr
or
base_type
.
is_array
:
...
...
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