2 parents d1f16fa + d04fa29 commit bc4a52dCopy full SHA for bc4a52d
1 file changed
Objects/unicodeobject.c
@@ -14324,11 +14324,12 @@ formatchar(PyObject *v)
14324
if (iobj == NULL) {
14325
goto onError;
14326
}
14327
- v = iobj;
+ x = PyLong_AsLong(iobj);
14328
Py_DECREF(iobj);
14329
14330
- /* Integer input truncated to a character */
14331
- x = PyLong_AsLong(v);
+ else {
+ x = PyLong_AsLong(v);
14332
+ }
14333
if (x == -1 && PyErr_Occurred())
14334
14335
0 commit comments