diff --git a/src/public/values.c b/src/public/values.c index f696f85d..0c35edb0 100644 --- a/src/public/values.c +++ b/src/public/values.c @@ -47,7 +47,10 @@ void py_newellipsis(py_OutRef out) { out->is_ptr = false; } -void py_newnil(py_OutRef out) { out->type = 0; } +void py_newnil(py_OutRef out) { + out->type = tp_nil; + out->is_ptr = false; +} void py_newnativefunc(py_OutRef out, py_CFunction f) { out->type = tp_nativefunc; diff --git a/tests/71_gc_bug.py b/tests/71_gc_bug.py index a5c244e2..24cd9002 100644 --- a/tests/71_gc_bug.py +++ b/tests/71_gc_bug.py @@ -40,7 +40,7 @@ a = [] del a assert gc.collect() == 1 -# a = [] -# a.append(a) -# del a -# assert gc.collect() == 1 +a = [] +a.append(a) +del a +assert gc.collect() == 1