Fix error creating C++ class
authorCraig Citro <craigcitro@gmail.com>
Sat, 13 Mar 2010 05:21:10 +0000 (21:21 -0800)
committerCraig Citro <craigcitro@gmail.com>
Sat, 13 Mar 2010 05:21:10 +0000 (21:21 -0800)
Cython/Compiler/Nodes.py
Cython/Compiler/Symtab.py

index f5da2453c6b340ebfed49c1b7538ab530d6cdbc4..9408693f17aff045818e8e667531dcb063de5e72 100644 (file)
@@ -1026,7 +1026,7 @@ class CppClassNode(CStructOrUnionDefNode):
 
     def analyse_declarations(self, env):
         scope = None
-        if len(self.attributes) != 0:
+        if self.attributes:
             scope = CppClassScope(self.name, env)
         else:
             self.attributes = None
index 464fab90d9540000482778ae2bdce9b4ff8ade82..9a4dd21e53d90c6e4bf2ad0696b7ee7889cdfa46 100644 (file)
@@ -423,8 +423,6 @@ class Scope(object):
                 if scope:
                     entry.type.scope = scope
                     self.type_entries.append(entry)
-        if not scope and not entry.type.scope:
-            entry.type.scope = CppClassScope(name, self)
         if templates is not None:
             for T in templates:
                 template_entry = entry.type.scope.declare(T.name, T.name, T, None, 'extern')