]> granicus.if.org Git - python/commitdiff
Remove support for u"..." literals.
authorGuido van Rossum <guido@python.org>
Fri, 11 May 2007 16:26:27 +0000 (16:26 +0000)
committerGuido van Rossum <guido@python.org>
Fri, 11 May 2007 16:26:27 +0000 (16:26 +0000)
Python/ast.c

index 58450766a422a0f1b61efd0131147cedc7265dff..a0c1812bbfe2a5fda61dca78af7bd5a78bb9e969 100644 (file)
@@ -3139,13 +3139,8 @@ parsestr(const node *n, const char *encoding, int *bytesmode)
     int quote = Py_CHARMASK(*s);
     int rawmode = 0;
     int need_encoding;
-    int unicode = 0;
 
     if (isalpha(quote) || quote == '_') {
-        if (quote == 'u' || quote == 'U') {
-            quote = *++s;
-            unicode = 1;
-        }
         if (quote == 'b' || quote == 'B') {
             quote = *++s;
             *bytesmode = 1;
@@ -3159,10 +3154,6 @@ parsestr(const node *n, const char *encoding, int *bytesmode)
         PyErr_BadInternalCall();
         return NULL;
     }
-    if (unicode && *bytesmode) {
-        ast_error(n, "string cannot be both bytes and unicode");
-        return NULL;
-    }
     s++;
     len = strlen(s);
     if (len > INT_MAX) {
@@ -3212,7 +3203,7 @@ parsestr(const node *n, const char *encoding, int *bytesmode)
         }
     }
 
-    return PyString_DecodeEscape(s, len, NULL, unicode,
+    return PyString_DecodeEscape(s, len, NULL, 1,
                                  need_encoding ? encoding : NULL);
 }