diff options
author | Walter Dörwald <walter@livinglogic.de> | 2007-05-31 15:51:35 (GMT) |
---|---|---|
committer | Walter Dörwald <walter@livinglogic.de> | 2007-05-31 15:51:35 (GMT) |
commit | 7696ed7b926dd73700ff9972d7a47beb7ec13191 (patch) | |
tree | 3e1a8bcb4d276591fcb62b40e26becd0784e5958 | |
parent | 346737fc193c9a2e7033519d9767132bc0c9312b (diff) | |
download | cpython-7696ed7b926dd73700ff9972d7a47beb7ec13191.zip cpython-7696ed7b926dd73700ff9972d7a47beb7ec13191.tar.gz cpython-7696ed7b926dd73700ff9972d7a47beb7ec13191.tar.bz2 |
Change float.__str__() and complex.__str__() to return
unicode objects.
-rw-r--r-- | Include/pyport.h | 1 | ||||
-rw-r--r-- | Objects/complexobject.c | 2 | ||||
-rw-r--r-- | Objects/floatobject.c | 2 |
3 files changed, 3 insertions, 2 deletions
diff --git a/Include/pyport.h b/Include/pyport.h index fb57ace..92ce3ae 100644 --- a/Include/pyport.h +++ b/Include/pyport.h @@ -107,6 +107,7 @@ typedef Py_intptr_t Py_ssize_t; * PyString_FromFormat * PyErr_Format * PyString_FromFormatV + * PyUnicode_FromFormatV * * Lower-level uses require that you interpolate the correct format modifier * yourself (e.g., calling printf, fprintf, sprintf, PyOS_snprintf); for diff --git a/Objects/complexobject.c b/Objects/complexobject.c index 0d4b755..ed2e475 100644 --- a/Objects/complexobject.c +++ b/Objects/complexobject.c @@ -350,7 +350,7 @@ complex_str(PyComplexObject *v) { char buf[100]; complex_to_buf(buf, sizeof(buf), v, PREC_STR); - return PyString_FromString(buf); + return PyUnicode_FromString(buf); } static long diff --git a/Objects/floatobject.c b/Objects/floatobject.c index 679e93e..b996863 100644 --- a/Objects/floatobject.c +++ b/Objects/floatobject.c @@ -310,7 +310,7 @@ float_str(PyFloatObject *v) { char buf[100]; format_float(buf, sizeof(buf), v, PREC_STR); - return PyString_FromString(buf); + return PyUnicode_FromString(buf); } /* Comparison is pretty much a nightmare. When comparing float to float, |