Get rid of all #ifdef Py_USING_UNICODE (it is always present now).

(With the help of unifdef from freshmeat.)
This commit is contained in:
Guido van Rossum 2007-05-03 17:49:24 +00:00
parent 938ef57e26
commit 8d30cc0144
36 changed files with 10 additions and 472 deletions

View file

@ -68,16 +68,13 @@ PyFloat_FromString(PyObject *v)
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
Py_ssize_t len;
if (PyString_Check(v)) {
s = PyString_AS_STRING(v);
len = PyString_GET_SIZE(v);
}
#ifdef Py_USING_UNICODE
else if (PyUnicode_Check(v)) {
if (PyUnicode_GET_SIZE(v) >= (Py_ssize_t)sizeof(s_buffer)) {
PyErr_SetString(PyExc_ValueError,
@ -92,7 +89,6 @@ PyFloat_FromString(PyObject *v)
s = s_buffer;
len = strlen(s);
}
#endif
else if (PyObject_AsCharBuffer(v, &s, &len)) {
PyErr_SetString(PyExc_TypeError,
"float() argument must be a string or a number");