Thanks to visit codestin.com Credit goes to github.com
We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 5bde08d commit 46872b1Copy full SHA for 46872b1
1 file changed
Python/exceptions.c
@@ -285,16 +285,22 @@ BaseException__unicode__(PyObject *self, PyObject *args)
285
}
286
else if (args_len == 1) {
287
PyObject *temp = PySequence_GetItem(args, 0);
288
+ PyObject *unicode_obj;
289
+
290
if (!temp) {
291
Py_DECREF(args);
292
return NULL;
293
294
- return PyObject_Unicode(temp);
295
+ unicode_obj = PyObject_Unicode(temp);
296
+ Py_DECREF(temp);
297
+ return unicode_obj;
298
299
else {
300
+ PyObject *unicode_obj = PyObject_Unicode(args);
301
302
- return PyObject_Unicode(args);
303
304
305
306
#endif /* Py_USING_UNICODE */
0 commit comments