summaryrefslogtreecommitdiffstats
path: root/Objects
diff options
context:
space:
mode:
authorXiang Zhang <angwerzx@126.com>2016-12-22 07:31:55 (GMT)
committerXiang Zhang <angwerzx@126.com>2016-12-22 07:31:55 (GMT)
commit62497d52d940c9e203c1bf5e5d41bba52577ec6a (patch)
treeb766d37d5cf7974facf7a948be8607ff50b7f8a3 /Objects
parentdb465b2860e07456b9504f711e7b402533114453 (diff)
parent437a5d2c25c2f64ddcdbf9c509d406071c74c1fb (diff)
downloadcpython-62497d52d940c9e203c1bf5e5d41bba52577ec6a.zip
cpython-62497d52d940c9e203c1bf5e5d41bba52577ec6a.tar.gz
cpython-62497d52d940c9e203c1bf5e5d41bba52577ec6a.tar.bz2
Issue #29044: Merge 3.6.
Diffstat (limited to 'Objects')
-rw-r--r--Objects/unicodeobject.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/Objects/unicodeobject.c b/Objects/unicodeobject.c
index bbda4d8..ef396fb 100644
--- a/Objects/unicodeobject.c
+++ b/Objects/unicodeobject.c
@@ -14286,11 +14286,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;