diff options
author | Neal Norwitz <nnorwitz@gmail.com> | 2007-08-26 04:51:10 (GMT) |
---|---|---|
committer | Neal Norwitz <nnorwitz@gmail.com> | 2007-08-26 04:51:10 (GMT) |
commit | ed2b7397a0558414e1ec61c48bc889bb05e261ea (patch) | |
tree | 2516676def25ff2857db8fffebbe97fb23c1cb54 /Objects/complexobject.c | |
parent | 6ea45d33412d4ecb2862645d57137b7ea1223281 (diff) | |
download | cpython-ed2b7397a0558414e1ec61c48bc889bb05e261ea.zip cpython-ed2b7397a0558414e1ec61c48bc889bb05e261ea.tar.gz cpython-ed2b7397a0558414e1ec61c48bc889bb05e261ea.tar.bz2 |
Use unicode and remove support for some uses of str8.
Diffstat (limited to 'Objects/complexobject.c')
-rw-r--r-- | Objects/complexobject.c | 10 |
1 files changed, 3 insertions, 7 deletions
diff --git a/Objects/complexobject.c b/Objects/complexobject.c index 253f714..fa493d7 100644 --- a/Objects/complexobject.c +++ b/Objects/complexobject.c @@ -649,11 +649,7 @@ complex_subtype_from_string(PyTypeObject *type, PyObject *v) char s_buffer[256]; Py_ssize_t len; - if (PyString_Check(v)) { - s = PyString_AS_STRING(v); - len = PyString_GET_SIZE(v); - } - else if (PyUnicode_Check(v)) { + if (PyUnicode_Check(v)) { if (PyUnicode_GET_SIZE(v) >= (Py_ssize_t)sizeof(s_buffer)) { PyErr_SetString(PyExc_ValueError, "complex() literal too large to convert"); @@ -833,7 +829,7 @@ complex_new(PyTypeObject *type, PyObject *args, PyObject *kwds) Py_INCREF(r); return r; } - if (PyString_Check(r) || PyUnicode_Check(r)) { + if (PyUnicode_Check(r)) { if (i != NULL) { PyErr_SetString(PyExc_TypeError, "complex() can't take second arg" @@ -842,7 +838,7 @@ complex_new(PyTypeObject *type, PyObject *args, PyObject *kwds) } return complex_subtype_from_string(type, r); } - if (i != NULL && (PyString_Check(i) || PyUnicode_Check(i))) { + if (i != NULL && PyUnicode_Check(i)) { PyErr_SetString(PyExc_TypeError, "complex() second arg can't be a string"); return NULL; |