From 0ce99d24a95e31e178c8f56c674673ebbf27b769 Mon Sep 17 00:00:00 2001 From: Robert Bradshaw Date: Wed, 7 Jul 2010 08:35:35 -0700 Subject: [PATCH] Test for #554, closures inside cdef block. --- tests/bugs.txt | 1 + tests/run/closure_inside_cdef_T554.pyx | 10 ++++++++++ 2 files changed, 11 insertions(+) create mode 100644 tests/run/closure_inside_cdef_T554.pyx diff --git a/tests/bugs.txt b/tests/bugs.txt index 5596f0f6..e7eac680 100644 --- a/tests/bugs.txt +++ b/tests/bugs.txt @@ -13,6 +13,7 @@ cpp_templated_ctypedef cpp_structs genexpr_T491 with_statement_module_level_T536 +closure_inside_cdef_T554 # CPython regression tests that don't current work: pyregr.test_threadsignals diff --git a/tests/run/closure_inside_cdef_T554.pyx b/tests/run/closure_inside_cdef_T554.pyx new file mode 100644 index 00000000..1232c6b7 --- /dev/null +++ b/tests/run/closure_inside_cdef_T554.pyx @@ -0,0 +1,10 @@ +def call_f(x): + """ + >>> call_f(2) + 4 + """ + return f(x) + +cdef f(x): # def here => works fine + def g(y): return y*x # cdef here => compile error + return g(x) # faults@ INCREF(.*cur_scope->.*v_x -- 2.26.2