don't complain when extension classes 'inherit' from object
authorStefan Behnel <scoder@users.berlios.de>
Sun, 21 Dec 2008 08:32:57 +0000 (09:32 +0100)
committerStefan Behnel <scoder@users.berlios.de>
Sun, 21 Dec 2008 08:32:57 +0000 (09:32 +0100)
Cython/Compiler/Nodes.py

index dc0255b4c767b61ae8c25e76e7a1e34a9b26db15..37511511512389a4661ca125c8c86f6fc32f253d 100644 (file)
@@ -2511,6 +2511,12 @@ class CClassDefNode(ClassDefNode):
                 base_class_scope = env.find_module(self.base_class_module, self.pos)
             else:
                 base_class_scope = env
+            if self.base_class_name == 'object':
+                # extension classes are special and don't need to inherit from object
+                if base_class_scope is None or base_class_scope.lookup('object') is None:
+                    self.base_class_name = None
+                    self.base_class_module = None
+                    base_class_scope = None
             if base_class_scope:
                 base_class_entry = base_class_scope.find(self.base_class_name, self.pos)
                 if base_class_entry: