summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--Objects/unicodeobject.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/Objects/unicodeobject.c b/Objects/unicodeobject.c
index 4491167..b0c410c 100644
--- a/Objects/unicodeobject.c
+++ b/Objects/unicodeobject.c
@@ -14324,11 +14324,12 @@ formatchar(PyObject *v)
if (iobj == NULL) {
goto onError;
}
- v = iobj;
+ x = PyLong_AsLong(iobj);
Py_DECREF(iobj);
}
- /* Integer input truncated to a character */
- x = PyLong_AsLong(v);
+ else {
+ x = PyLong_AsLong(v);
+ }
if (x == -1 && PyErr_Occurred())
goto onError;