diff options
author | Guido van Rossum <guido@python.org> | 2007-05-11 16:26:27 (GMT) |
---|---|---|
committer | Guido van Rossum <guido@python.org> | 2007-05-11 16:26:27 (GMT) |
commit | bdde01168fc91d02a2d3bc8399255944fdfdd69f (patch) | |
tree | 6414d9db65bc83afbaedea83edb3302caac20403 /Python | |
parent | 0ac30f82fe1beb4e0255d06c693ccfba56e45a9f (diff) | |
download | cpython-bdde01168fc91d02a2d3bc8399255944fdfdd69f.zip cpython-bdde01168fc91d02a2d3bc8399255944fdfdd69f.tar.gz cpython-bdde01168fc91d02a2d3bc8399255944fdfdd69f.tar.bz2 |
Remove support for u"..." literals.
Diffstat (limited to 'Python')
-rw-r--r-- | Python/ast.c | 11 |
1 files changed, 1 insertions, 10 deletions
diff --git a/Python/ast.c b/Python/ast.c index 5845076..a0c1812 100644 --- a/Python/ast.c +++ b/Python/ast.c @@ -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); } |