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
Labels
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Commits
Open sidebar
nexedi
cython
Commits
96925842
Commit
96925842
authored
Nov 07, 2010
by
Stefan Behnel
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix exception type on None error
parent
fd11571a
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
3 additions
and
2 deletions
+3
-2
Cython/Compiler/ExprNodes.py
Cython/Compiler/ExprNodes.py
+2
-1
tests/run/set.pyx
tests/run/set.pyx
+1
-1
No files found.
Cython/Compiler/ExprNodes.py
View file @
96925842
...
...
@@ -2839,7 +2839,8 @@ class SimpleCallNode(CallNode):
self_arg
=
func_type
.
args
[
0
]
if
self_arg
.
not_none
:
# C methods must do the None test for self at *call* time
self
.
self
=
self
.
self
.
as_none_safe_node
(
"'NoneType' object has no attribute '%s'"
%
self
.
function
.
entry
.
name
)
"'NoneType' object has no attribute '%s'"
%
self
.
function
.
entry
.
name
,
'PyExc_AttributeError'
)
expected_type
=
self_arg
.
type
self
.
coerced_self
=
CloneNode
(
self
.
self
).
coerce_to
(
expected_type
,
env
)
...
...
tests/run/set.pyx
View file @
96925842
...
...
@@ -60,7 +60,7 @@ def test_set_clear_None():
"""
>>> test_set_clear_None()
Traceback (most recent call last):
Typ
eError: 'NoneType' object has no attribute 'clear'
Attribut
eError: 'NoneType' object has no attribute 'clear'
"""
cdef
set
s1
=
None
s1
.
clear
()
...
...
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