diff options
author | Guido van Rossum <guido@python.org> | 2007-08-16 21:02:22 (GMT) |
---|---|---|
committer | Guido van Rossum <guido@python.org> | 2007-08-16 21:02:22 (GMT) |
commit | 066100909ae45e7acd59b2ac81338d3cfcf44384 (patch) | |
tree | f4efeff775968cf39364638744cadd0fdc5fbfbd /Objects | |
parent | 5f22af167f0a5cecdd79c9381e1150ab2b503be1 (diff) | |
download | cpython-066100909ae45e7acd59b2ac81338d3cfcf44384.zip cpython-066100909ae45e7acd59b2ac81338d3cfcf44384.tar.gz cpython-066100909ae45e7acd59b2ac81338d3cfcf44384.tar.bz2 |
Get rid of some dead code and unneeded XXX comments by Neal.
Diffstat (limited to 'Objects')
-rw-r--r-- | Objects/unicodeobject.c | 14 |
1 files changed, 3 insertions, 11 deletions
diff --git a/Objects/unicodeobject.c b/Objects/unicodeobject.c index e9f97df..b345986 100644 --- a/Objects/unicodeobject.c +++ b/Objects/unicodeobject.c @@ -1189,17 +1189,9 @@ PyObject *_PyUnicode_AsDefaultEncodedString(PyObject *unicode, return v; if (errors != NULL) Py_FatalError("non-NULL encoding in _PyUnicode_AsDefaultEncodedString"); - /* XXX(nnorwitz): errors will always be NULL due to the check above. - Should this check and the else be removed since it's dead code? - */ - if (errors == NULL) { - b = PyUnicode_EncodeUTF8(PyUnicode_AS_UNICODE(unicode), - PyUnicode_GET_SIZE(unicode), - NULL); - } - else { - b = PyUnicode_AsEncodedString(unicode, NULL, errors); - } + b = PyUnicode_EncodeUTF8(PyUnicode_AS_UNICODE(unicode), + PyUnicode_GET_SIZE(unicode), + NULL); if (!b) return NULL; v = PyString_FromStringAndSize(PyBytes_AsString(b), |