fix exception handling for optimised len(builtin)
authorStefan Behnel <stefan_ml@behnel.de>
Mon, 9 Jul 2012 19:36:00 +0000 (21:36 +0200)
committerStefan Behnel <stefan_ml@behnel.de>
Mon, 9 Jul 2012 19:36:00 +0000 (21:36 +0200)
Cython/Compiler/Optimize.py

index 22a021e..244912a 100644 (file)
@@ -2064,7 +2064,8 @@ class OptimizeBuiltinCalls(Visitor.EnvTransform):
     PyObject_Size_func_type = PyrexTypes.CFuncType(
         PyrexTypes.c_py_ssize_t_type, [
             PyrexTypes.CFuncTypeArg("obj", PyrexTypes.py_object_type, None)
-            ])
+            ],
+        exception_value="-1")
 
     _map_to_capi_len_function = {
         Builtin.unicode_type   : "__Pyx_PyUnicode_GET_LENGTH",