diff Python/exceptions.c @ 36799:42487d8cf338 legacy-trunk

Add a missing Py_DECREF to BaseException__unicode__ .
author Brett Cannon <bcannon@gmail.com>
date Thu, 02 Mar 2006 04:31:55 +0000
parents 25f8e6dde4a3
children d02b4cfefa0a
line wrap: on
line diff
--- a/Python/exceptions.c	Thu Mar 02 04:24:01 2006 +0000
+++ b/Python/exceptions.c	Thu Mar 02 04:31:55 2006 +0000
@@ -285,16 +285,22 @@
 	}
 	else if (args_len == 1) {
 		PyObject *temp = PySequence_GetItem(args, 0);
+		PyObject *unicode_obj;
+
 		if (!temp) {
 			Py_DECREF(args);
 			return NULL;
 		}
 		Py_DECREF(args);
-		return PyObject_Unicode(temp);
+		unicode_obj = PyObject_Unicode(temp);
+		Py_DECREF(temp);
+		return unicode_obj;
 	}
 	else {
+		PyObject *unicode_obj = PyObject_Unicode(args);
+
 		Py_DECREF(args);
-		return PyObject_Unicode(args);
+		return unicode_obj;
 	}
 }
 #endif /* Py_USING_UNICODE */