From: Stefan Behnel Date: Mon, 1 Sep 2008 11:30:13 +0000 (+0200) Subject: missing DECREF in WriteUnraisable X-Git-Tag: 0.9.9.2.beta~63^2~16 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=e74368f39425432af36c3e5c340bb5e8fccddf3d;p=cython.git missing DECREF in WriteUnraisable --- diff --git a/Cython/Compiler/Nodes.py b/Cython/Compiler/Nodes.py index def2e025..890c658b 100644 --- a/Cython/Compiler/Nodes.py +++ b/Cython/Compiler/Nodes.py @@ -4579,9 +4579,12 @@ static void __Pyx_WriteUnraisable(const char *name) { ctx = PyUnicode_FromString(name); #endif __Pyx_ErrRestore(old_exc, old_val, old_tb); - if (!ctx) - ctx = Py_None; - PyErr_WriteUnraisable(ctx); + if (!ctx) { + PyErr_WriteUnraisable(Py_None); + } else { + PyErr_WriteUnraisable(ctx); + Py_DECREF(ctx); + } } """]