Commit 38ca41a3 authored by gsamain's avatar gsamain

Forbid inheritance between PyExt and CyExt

parent 8dd69721
......@@ -4840,6 +4840,12 @@ class CClassDefNode(ClassDefNode):
base_type.name in ('tuple', 'str', 'bytes'):
error(base.pos, "inheritance from PyVarObject types like '%s' is not currently supported"
% base_type.name)
elif base_type.is_extension_type and (base_type.nogil != self.nogil):
error(base.pos, """
inheritance between PyExtensionType and CythonExtensionType is not currently supported
(trying to make %s inherit from %s)
"""
% (self.class_name, base_type.name))
else:
self.base_type = base_type
if env.directives.get('freelist', 0) > 0 and base_type != PyrexTypes.py_object_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