diff options
author | Stefan Behnel <stefan_ml@behnel.de> | 2014-01-10 18:11:31 +0100 |
---|---|---|
committer | Stefan Behnel <stefan_ml@behnel.de> | 2014-01-10 18:11:31 +0100 |
commit | 9ef2b06720b0d5314452cc32214d8606619e0b87 (patch) | |
tree | 3b8730e601591b8e7194e48000c239c55539b3fa /Cython/Compiler/ModuleNode.py | |
parent | 5f6bc132a55ec8d2d19e5b3000ce8c5801af32d6 (diff) | |
download | cython-9ef2b06720b0d5314452cc32214d8606619e0b87.tar.gz |
revert dynamic tp_new() override because it breaks instantiating types with arguments that object.__new__()/object.__init__() don't expect
Diffstat (limited to 'Cython/Compiler/ModuleNode.py')
-rw-r--r-- | Cython/Compiler/ModuleNode.py | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/Cython/Compiler/ModuleNode.py b/Cython/Compiler/ModuleNode.py index 827bd9095..13d626b03 100644 --- a/Cython/Compiler/ModuleNode.py +++ b/Cython/Compiler/ModuleNode.py @@ -1068,8 +1068,7 @@ class ModuleNode(Nodes.Node, Nodes.BlockNode): type.declaration_code(""))) def generate_new_function(self, scope, code, cclass_entry): - # keep this function in sync with ConstructorSlot.can_reuse_baseobject_tp_new() - tp_slot = TypeSlots.ConstructorSlot("tp_new") + tp_slot = TypeSlots.ConstructorSlot("tp_new", '__new__') slot_func = scope.mangle_internal("tp_new") type = scope.parent_type base_type = type.base_type @@ -1189,7 +1188,7 @@ class ModuleNode(Nodes.Node, Nodes.BlockNode): "}") def generate_dealloc_function(self, scope, code): - tp_slot = TypeSlots.DestructorSlot("tp_dealloc", '__dealloc__') + tp_slot = TypeSlots.ConstructorSlot("tp_dealloc", '__dealloc__') slot_func = scope.mangle_internal("tp_dealloc") base_type = scope.parent_type.base_type if tp_slot.slot_code(scope) != slot_func: |