mirror of
https://github.com/python/cpython.git
synced 2025-08-29 13:15:11 +00:00
Get rid of some dead code and unneeded XXX comments by Neal.
This commit is contained in:
parent
5f22af167f
commit
066100909a
2 changed files with 4 additions and 17 deletions
|
@ -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),
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue