summaryrefslogtreecommitdiffstats
path: root/Objects/unicodeobject.c
diff options
context:
space:
mode:
authorXiang Zhang <angwerzx@126.com>2016-12-22 07:31:22 (GMT)
committerXiang Zhang <angwerzx@126.com>2016-12-22 07:31:22 (GMT)
commit437a5d2c25c2f64ddcdbf9c509d406071c74c1fb (patch)
tree9264f2985f8b86f8b3c0b8c579dca62793737ba1 /Objects/unicodeobject.c
parent0ba0defb00ebc94eb7b0fb8c3fcb699b9a211174 (diff)
parentea1cf870305ad46fae53d338474b6b13f7fe14d4 (diff)
downloadcpython-437a5d2c25c2f64ddcdbf9c509d406071c74c1fb.zip
cpython-437a5d2c25c2f64ddcdbf9c509d406071c74c1fb.tar.gz
cpython-437a5d2c25c2f64ddcdbf9c509d406071c74c1fb.tar.bz2
Issue #29044: Merge 3.5.
Diffstat (limited to 'Objects/unicodeobject.c')
-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;