scope isn't always set for new classes
authorStefan Behnel <scoder@users.berlios.de>
Wed, 11 Jun 2008 19:51:25 +0000 (21:51 +0200)
committerStefan Behnel <scoder@users.berlios.de>
Wed, 11 Jun 2008 19:51:25 +0000 (21:51 +0200)
Cython/Compiler/Symtab.py

index 313f4fc79c490d48e2d447a46a8b4777e5220c87..ffe2ebbc4bfae1ff85fc5f773e7ff11b09fac219 100644 (file)
@@ -919,7 +919,7 @@ class ModuleScope(Scope):
                 entry = None # Will cause redeclaration and produce an error
             else:
                 scope = type.scope
-                if typedef_flag and scope.defined:
+                if typedef_flag and (scope and scope.defined):
                     self.check_previous_typedef_flag(entry, typedef_flag, pos)
                 if (scope and scope.defined) or (base_type and type.base_type):
                     if base_type and base_type is not type.base_type: