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
76c52f26
Commit
76c52f26
authored
May 09, 2012
by
Mark Florisson
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Use PyErr_Format to format attribute names
parent
6e8dd308
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
3 deletions
+7
-3
Cython/Compiler/ExprNodes.py
Cython/Compiler/ExprNodes.py
+7
-3
No files found.
Cython/Compiler/ExprNodes.py
View file @
76c52f26
...
...
@@ -4493,9 +4493,11 @@ class AttributeNode(ExprNode):
return
msg
=
None
format_args
=
()
if
(
self
.
obj
.
type
.
is_extension_type
and
self
.
needs_none_check
and
not
self
.
is_py_attr
):
msg
=
"'NoneType' object has no attribute '%s'"
%
self
.
attribute
msg
=
"'NoneType' object has no attribute '%s'"
format_args
=
(
self
.
attribute
,)
elif
self
.
obj
.
type
.
is_memoryviewslice
:
if
self
.
is_memslice_transpose
:
msg
=
"Cannot transpose None memoryview slice"
...
...
@@ -4503,10 +4505,12 @@ class AttributeNode(ExprNode):
entry
=
self
.
obj
.
type
.
scope
.
lookup_here
(
self
.
attribute
)
if
entry
:
# copy/is_c_contig/shape/strides etc
msg
=
"Cannot access '%s' attribute of None memoryview slice"
%
entry
.
name
msg
=
"Cannot access '%s' attribute of None memoryview slice"
format_args
=
(
entry
.
name
,)
if
msg
:
self
.
obj
=
self
.
obj
.
as_none_safe_node
(
msg
,
'PyExc_AttributeError'
)
self
.
obj
=
self
.
obj
.
as_none_safe_node
(
msg
,
'PyExc_AttributeError'
,
format_args
=
format_args
)
def
nogil_check
(
self
,
env
):
...
...
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