Commit 1eabb1c6 authored by Mark Florisson's avatar Mark Florisson

NumPy stopgap: fix type access before type is set and visit children

parent ec0add58
......@@ -4429,7 +4429,9 @@ class AttributeNode(ExprNode):
# attribute.
pass
# 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
replacement_node = numpy_transform_attribute_node(self)
# Since we can't actually replace our node yet, we only grasp its
......
......@@ -1797,6 +1797,8 @@ class AnalyseExpressionsTransform(CythonTransform):
if type.is_extension_type and type.objstruct_cname == 'PyArrayObject':
from NumpySupport import numpy_transform_attribute_node
node = numpy_transform_attribute_node(node)
self.visitchildren(node)
return node
class FindInvalidUseOfFusedTypes(CythonTransform):
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment