diff options
author | Xiang Zhang <angwerzx@126.com> | 2016-12-22 07:31:22 (GMT) |
---|---|---|
committer | Xiang Zhang <angwerzx@126.com> | 2016-12-22 07:31:22 (GMT) |
commit | 437a5d2c25c2f64ddcdbf9c509d406071c74c1fb (patch) | |
tree | 9264f2985f8b86f8b3c0b8c579dca62793737ba1 | |
parent | 0ba0defb00ebc94eb7b0fb8c3fcb699b9a211174 (diff) | |
parent | ea1cf870305ad46fae53d338474b6b13f7fe14d4 (diff) | |
download | cpython-437a5d2c25c2f64ddcdbf9c509d406071c74c1fb.zip cpython-437a5d2c25c2f64ddcdbf9c509d406071c74c1fb.tar.gz cpython-437a5d2c25c2f64ddcdbf9c509d406071c74c1fb.tar.bz2 |
Issue #29044: Merge 3.5.
-rw-r--r-- | Objects/unicodeobject.c | 7 |
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; |