From 2ee90df63c496f3ba748dd020156dad853f38ba1 Mon Sep 17 00:00:00 2001 From: Paul Brossier Date: Wed, 11 May 2016 15:26:53 +0200 Subject: [PATCH] python/lib/gen_code.py: fix error string --- python/lib/gen_code.py | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/python/lib/gen_code.py b/python/lib/gen_code.py index e3b0df96..32e9baa6 100644 --- a/python/lib/gen_code.py +++ b/python/lib/gen_code.py @@ -299,11 +299,7 @@ Py_{shortname}_init (Py_{shortname} * self, PyObject * args, PyObject * kwds) out += """ // return -1 and set error string on failure if (self->o == NULL) {{ - //char_t errstr[30 + strlen(self->uri)]; - //sprintf(errstr, "error creating {shortname} with params {paramchars}", {paramvals}); - char_t errstr[60]; - sprintf(errstr, "error creating {shortname} with given params"); - PyErr_SetString (PyExc_Exception, errstr); + PyErr_Format (PyExc_Exception, "failed creating {shortname}"); return -1; }} """.format(paramchars = paramchars, paramvals = paramvals, **self.__dict__) -- 2.11.0