summaryrefslogtreecommitdiffstats
path: root/Objects
diff options
context:
space:
mode:
authorSenthil Kumaran <senthil@uthcode.com>2011-07-04 04:03:16 (GMT)
committerSenthil Kumaran <senthil@uthcode.com>2011-07-04 04:03:16 (GMT)
commit9ebe08d2f6c3b8bca5148e909cc89efeb7a01ad1 (patch)
tree14b187f19e9c85236091dd81dcfabcfcd4db3682 /Objects
parenta55007a620792a6dff946ee04b1295689e70b616 (diff)
downloadcpython-9ebe08d2f6c3b8bca5148e909cc89efeb7a01ad1.zip
cpython-9ebe08d2f6c3b8bca5148e909cc89efeb7a01ad1.tar.gz
cpython-9ebe08d2f6c3b8bca5148e909cc89efeb7a01ad1.tar.bz2
Fix closes issue12471 - wrong TypeError message when '%i' format spec was used.
Diffstat (limited to 'Objects')
-rw-r--r--Objects/unicodeobject.c4
1 files changed, 1 insertions, 3 deletions
diff --git a/Objects/unicodeobject.c b/Objects/unicodeobject.c
index 7a70a5e..03807a4 100644
--- a/Objects/unicodeobject.c
+++ b/Objects/unicodeobject.c
@@ -9689,8 +9689,6 @@ PyObject *PyUnicode_Format(PyObject *format,
case 'o':
case 'x':
case 'X':
- if (c == 'i')
- c = 'd';
isnumok = 0;
if (PyNumber_Check(v)) {
PyObject *iobj=NULL;
@@ -9705,7 +9703,7 @@ PyObject *PyUnicode_Format(PyObject *format,
if (iobj!=NULL) {
if (PyLong_Check(iobj)) {
isnumok = 1;
- temp = formatlong(iobj, flags, prec, c);
+ temp = formatlong(iobj, flags, prec, (c == 'i'? 'd': c));
Py_DECREF(iobj);
if (!temp)
goto onError;