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
1eabb1c6
Commit
1eabb1c6
authored
Mar 31, 2012
by
Mark Florisson
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
NumPy stopgap: fix type access before type is set and visit children
parent
ec0add58
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
5 additions
and
1 deletion
+5
-1
Cython/Compiler/ExprNodes.py
Cython/Compiler/ExprNodes.py
+3
-1
Cython/Compiler/ParseTreeTransforms.py
Cython/Compiler/ParseTreeTransforms.py
+2
-0
No files found.
Cython/Compiler/ExprNodes.py
View file @
1eabb1c6
...
@@ -4429,7 +4429,9 @@ class AttributeNode(ExprNode):
...
@@ -4429,7 +4429,9 @@ class AttributeNode(ExprNode):
# attribute.
# attribute.
pass
pass
# NumPy hack
# NumPy hack
if
obj_type
.
is_extension_type
and
obj_type
.
objstruct_cname
==
'PyArrayObject'
:
if
(
getattr
(
self
.
obj
,
'type'
,
None
)
and
obj_type
.
is_extension_type
and
obj_type
.
objstruct_cname
==
'PyArrayObject'
):
from
NumpySupport
import
numpy_transform_attribute_node
from
NumpySupport
import
numpy_transform_attribute_node
replacement_node
=
numpy_transform_attribute_node
(
self
)
replacement_node
=
numpy_transform_attribute_node
(
self
)
# Since we can't actually replace our node yet, we only grasp its
# Since we can't actually replace our node yet, we only grasp its
...
...
Cython/Compiler/ParseTreeTransforms.py
View file @
1eabb1c6
...
@@ -1797,6 +1797,8 @@ class AnalyseExpressionsTransform(CythonTransform):
...
@@ -1797,6 +1797,8 @@ class AnalyseExpressionsTransform(CythonTransform):
if
type
.
is_extension_type
and
type
.
objstruct_cname
==
'PyArrayObject'
:
if
type
.
is_extension_type
and
type
.
objstruct_cname
==
'PyArrayObject'
:
from
NumpySupport
import
numpy_transform_attribute_node
from
NumpySupport
import
numpy_transform_attribute_node
node
=
numpy_transform_attribute_node
(
node
)
node
=
numpy_transform_attribute_node
(
node
)
self
.
visitchildren
(
node
)
return
node
return
node
class
FindInvalidUseOfFusedTypes
(
CythonTransform
):
class
FindInvalidUseOfFusedTypes
(
CythonTransform
):
...
...
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