]> granicus.if.org Git - python/commitdiff
bpo-29803: remove a redandunt op and fix a comment in unicodeobject.c (#660)
authorXiang Zhang <angwerzx@126.com>
Tue, 13 Feb 2018 10:33:32 +0000 (18:33 +0800)
committerGitHub <noreply@github.com>
Tue, 13 Feb 2018 10:33:32 +0000 (18:33 +0800)
Objects/unicodeobject.c

index 02334382cabe51275c5387fc7718f3e8eb8a3a46..1ae2f5e018fe8e182cb8a2c898406d2863326e16 100644 (file)
@@ -3727,10 +3727,6 @@ PyUnicode_FSDecoder(PyObject* arg, void* addr)
     }
 
     if (PyUnicode_Check(path)) {
-        if (PyUnicode_READY(path) == -1) {
-            Py_DECREF(path);
-            return 0;
-        }
         output = path;
     }
     else if (PyBytes_Check(path) || is_buffer) {
@@ -6426,7 +6422,7 @@ PyUnicode_AsRawUnicodeEscapeString(PyObject *unicode)
         if (ch < 0x100) {
             *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) {
             *p++ = '\\';
             *p++ = 'u';