From: Stefan Behnel Date: Wed, 13 Apr 2011 18:36:38 +0000 (+0200) Subject: fix #682: compiler crash on auto_cpdef redefinition X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=37d4884476b43b38536d47190a24e2d67f9252cf;p=cython.git fix #682: compiler crash on auto_cpdef redefinition --- diff --git a/Cython/Compiler/ParseTreeTransforms.py b/Cython/Compiler/ParseTreeTransforms.py index d70dce80..e004852e 100644 --- a/Cython/Compiler/ParseTreeTransforms.py +++ b/Cython/Compiler/ParseTreeTransforms.py @@ -1399,7 +1399,8 @@ class AlignFunctionDefinitions(CythonTransform): return self.visit_CClassDefNode(node.as_cclass(), pxd_def) else: error(node.pos, "'%s' redeclared" % node.name) - error(pxd_def.pos, "previous declaration here") + if pxd_def.pos: + error(pxd_def.pos, "previous declaration here") return None else: return node @@ -1420,7 +1421,8 @@ class AlignFunctionDefinitions(CythonTransform): if pxd_def: if not pxd_def.is_cfunction: error(node.pos, "'%s' redeclared" % node.name) - error(pxd_def.pos, "previous declaration here") + if pxd_def.pos: + error(pxd_def.pos, "previous declaration here") return None node = node.as_cfunction(pxd_def) elif self.scope.is_module_scope and self.directives['auto_cpdef']: