diff options
author | Martin v. Löwis <martin@v.loewis.de> | 2001-08-17 18:39:25 (GMT) |
---|---|---|
committer | Martin v. Löwis <martin@v.loewis.de> | 2001-08-17 18:39:25 (GMT) |
commit | 339d0f720e86dc34837547c90d3003a4a68d7d46 (patch) | |
tree | 2059e5d02f490540e759800b127d50f3fcd8c2b5 /Objects/floatobject.c | |
parent | f75976617bb36c892ee8a0f6a6fd3caddbd38cea (diff) | |
download | cpython-339d0f720e86dc34837547c90d3003a4a68d7d46.zip cpython-339d0f720e86dc34837547c90d3003a4a68d7d46.tar.gz cpython-339d0f720e86dc34837547c90d3003a4a68d7d46.tar.bz2 |
Patch #445762: Support --disable-unicode
- Do not compile unicodeobject, unicodectype, and unicodedata if Unicode is disabled
- check for Py_USING_UNICODE in all places that use Unicode functions
- disables unicode literals, and the builtin functions
- add the types.StringTypes list
- remove Unicode literals from most tests.
Diffstat (limited to 'Objects/floatobject.c')
-rw-r--r-- | Objects/floatobject.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/Objects/floatobject.c b/Objects/floatobject.c index 34b252b..044d1d3 100644 --- a/Objects/floatobject.c +++ b/Objects/floatobject.c @@ -109,7 +109,9 @@ PyFloat_FromString(PyObject *v, char **pend) const char *s, *last, *end; double x; char buffer[256]; /* for errors */ +#ifdef Py_USING_UNICODE char s_buffer[256]; /* for objects convertible to a char buffer */ +#endif int len; if (pend) @@ -118,6 +120,7 @@ PyFloat_FromString(PyObject *v, char **pend) s = PyString_AS_STRING(v); len = PyString_GET_SIZE(v); } +#ifdef Py_USING_UNICODE else if (PyUnicode_Check(v)) { if (PyUnicode_GET_SIZE(v) >= sizeof(s_buffer)) { PyErr_SetString(PyExc_ValueError, @@ -132,6 +135,7 @@ PyFloat_FromString(PyObject *v, char **pend) s = s_buffer; len = (int)strlen(s); } +#endif else if (PyObject_AsCharBuffer(v, &s, &len)) { PyErr_SetString(PyExc_TypeError, "float() needs a string argument"); |