[Python-3000-checkins] r55268 - python/branches/py3k-struni/Python/ast.c
guido.van.rossum
python-3000-checkins at python.org
Fri May 11 18:26:33 CEST 2007
Author: guido.van.rossum
Date: Fri May 11 18:26:27 2007
New Revision: 55268
Modified:
python/branches/py3k-struni/Python/ast.c
Log:
Remove support for u"..." literals.
Modified: python/branches/py3k-struni/Python/ast.c
==============================================================================
--- python/branches/py3k-struni/Python/ast.c (original)
+++ python/branches/py3k-struni/Python/ast.c Fri May 11 18:26:27 2007
@@ -3139,13 +3139,8 @@
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 @@
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 @@
}
}
- return PyString_DecodeEscape(s, len, NULL, unicode,
+ return PyString_DecodeEscape(s, len, NULL, 1,
need_encoding ? encoding : NULL);
}
More information about the Python-3000-checkins
mailing list