From cec8145deb597e9f357f9918b77bcae638df692a Mon Sep 17 00:00:00 2001 From: Craig Citro Date: Fri, 12 Mar 2010 21:21:10 -0800 Subject: [PATCH] Fix error creating C++ class --- Cython/Compiler/Nodes.py | 2 +- Cython/Compiler/Symtab.py | 2 -- 2 files changed, 1 insertion(+), 3 deletions(-) diff --git a/Cython/Compiler/Nodes.py b/Cython/Compiler/Nodes.py index f5da2453..9408693f 100644 --- a/Cython/Compiler/Nodes.py +++ b/Cython/Compiler/Nodes.py @@ -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 diff --git a/Cython/Compiler/Symtab.py b/Cython/Compiler/Symtab.py index 464fab90..9a4dd21e 100644 --- a/Cython/Compiler/Symtab.py +++ b/Cython/Compiler/Symtab.py @@ -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') -- 2.26.2