Commit cf2ffbcc authored by Robert Bradshaw's avatar Robert Bradshaw

Cleanup.

parent c2e7b11e
......@@ -4593,14 +4593,13 @@ class CClassDefNode(ClassDefNode):
base_type = base.analyse_as_type(env)
if base_type in (PyrexTypes.c_int_type, PyrexTypes.c_long_type, PyrexTypes.c_float_type):
# Use the Python rather than C variant of these types.
base_type = env.lookup(str(base_type)).type
base_type = env.lookup(base_type.sign_and_name()).type
if base_type is None:
error(base.pos, "First base of '%s' is not an extension type" % self.class_name)
elif base_type == PyrexTypes.py_object_type:
base_class_scope = None
elif not base_type.is_extension_type and \
not (base_type.is_builtin_type and base_type.objstruct_cname):
print (base_type, base_type.is_builtin_type)
error(base.pos, "'%s' is not an extension type" % base_type)
elif not base_type.is_complete():
error(base.pos, "Base class '%s' of type '%s' is incomplete" % (
......@@ -4691,7 +4690,7 @@ class CClassDefNode(ClassDefNode):
from . import ExprNodes
self.type_init_args = ExprNodes.TupleNode(
self.pos,
args=[ExprNodes.StringNode(self.pos, value=self.class_name),
args=[ExprNodes.IdentifierStringNode(self.pos, value=self.class_name),
self.bases,
ExprNodes.DictNode(self.pos, key_value_pairs=[])])
elif self.base_type:
......@@ -4761,7 +4760,8 @@ class CClassDefNode(ClassDefNode):
type = entry.type
typeobj_cname = type.typeobj_cname
scope = type.scope
if scope: # could be None if there was an error
if not scope: # could be None if there was an error
return
if entry.visibility != 'extern':
for slot in TypeSlots.slot_table:
slot.generate_dynamic_init_code(scope, code)
......
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