Commit a3da6eba authored by Xavier Thompson's avatar Xavier Thompson

Keep 'del' statement from inferring cypclass to pyobject

parent a50b90e3
......@@ -374,7 +374,9 @@ class NameDeletion(NameAssignment):
def infer_type(self):
inferred_type = self.rhs.infer_type(self.entry.scope)
if (not inferred_type.is_pyobject
and inferred_type.can_coerce_to_pyobject(self.entry.scope)):
and inferred_type.can_coerce_to_pyobject(self.entry.scope)
and not inferred_type.is_cyp_class):
# do not coerce cypclass to pyobject just for a del statement
return PyrexTypes.py_object_type
self.inferred_type = inferred_type
return inferred_type
......
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