Commit 2ff98daa authored by Xavier Thompson's avatar Xavier Thompson

Avoid wrapping cypclasses where __new__ returns another type

parent bf02b029
...@@ -153,6 +153,11 @@ def NAME(self, ARGDECLS): ...@@ -153,6 +153,11 @@ def NAME(self, ARGDECLS):
# skip forward declarations # skip forward declarations
return return
new_entry = node.scope.lookup_here("__new__")
if new_entry and new_entry.type.return_type is not node.entry.type:
# skip cypclasses that don't instanciate their own type
return
# indicate that the cypclass will have a wrapper # indicate that the cypclass will have a wrapper
node.entry.type.support_wrapper = True node.entry.type.support_wrapper = True
......
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