From b1a0e894aa10a343877beef870b33a0218003b5b Mon Sep 17 00:00:00 2001 From: Stefan Behnel Date: Wed, 12 May 2010 22:20:21 +0200 Subject: [PATCH] error handling in __test__ dict creation code --- Cython/Compiler/ExprNodes.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/Cython/Compiler/ExprNodes.py b/Cython/Compiler/ExprNodes.py index 6cb86bc2..42c06fb5 100755 --- a/Cython/Compiler/ExprNodes.py +++ b/Cython/Compiler/ExprNodes.py @@ -6512,8 +6512,9 @@ class DocstringRefNode(ExprNode): pass def generate_result_code(self, code): - code.putln('%s = __Pyx_GetAttrString(%s, "__doc__");' % - (self.result(), self.body.result())) + code.putln('%s = __Pyx_GetAttrString(%s, "__doc__"); %s' % ( + self.result(), self.body.result(), + code.error_goto_if_null(self.result(), self.pos))) code.put_gotref(self.result()) -- 2.26.2