From 37d4884476b43b38536d47190a24e2d67f9252cf Mon Sep 17 00:00:00 2001 From: Stefan Behnel Date: Wed, 13 Apr 2011 20:36:38 +0200 Subject: [PATCH] fix #682: compiler crash on auto_cpdef redefinition --- Cython/Compiler/ParseTreeTransforms.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) 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']: -- 2.26.2