bpo-29803: remove a redandunt op and fix a comment in unicodeobject.c (#660)

This commit is contained in:
Xiang Zhang 2018-02-13 18:33:32 +08:00 committed by GitHub
parent d019bc8319
commit 2b77a921e6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 5 deletions

View File

@ -3727,10 +3727,6 @@ PyUnicode_FSDecoder(PyObject* arg, void* addr)
} }
if (PyUnicode_Check(path)) { if (PyUnicode_Check(path)) {
if (PyUnicode_READY(path) == -1) {
Py_DECREF(path);
return 0;
}
output = path; output = path;
} }
else if (PyBytes_Check(path) || is_buffer) { else if (PyBytes_Check(path) || is_buffer) {
@ -6426,7 +6422,7 @@ PyUnicode_AsRawUnicodeEscapeString(PyObject *unicode)
if (ch < 0x100) { if (ch < 0x100) {
*p++ = (char) ch; *p++ = (char) ch;
} }
/* U+0000-U+00ff range: Map 16-bit characters to '\uHHHH' */ /* U+0100-U+ffff range: Map 16-bit characters to '\uHHHH' */
else if (ch < 0x10000) { else if (ch < 0x10000) {
*p++ = '\\'; *p++ = '\\';
*p++ = 'u'; *p++ = 'u';