error handling in __test__ dict creation code
authorStefan Behnel <scoder@users.berlios.de>
Wed, 12 May 2010 20:20:21 +0000 (22:20 +0200)
committerStefan Behnel <scoder@users.berlios.de>
Wed, 12 May 2010 20:20:21 +0000 (22:20 +0200)
Cython/Compiler/ExprNodes.py

index 6cb86bc2b9f1bc032ff5e5a953f993bd178ba90a..42c06fb5ef8d883e9320df7bd41ceb2cd54286ee 100755 (executable)
@@ -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())