diff options
author | Benjamin Peterson <benjamin@python.org> | 2011-09-01 02:13:03 (GMT) |
---|---|---|
committer | Benjamin Peterson <benjamin@python.org> | 2011-09-01 02:13:03 (GMT) |
commit | 0224d4e6992fdc91d8c095c7657bfcd7ce7a07a8 (patch) | |
tree | 1c54b30efdc96ddf8d557e02075d6daf1dbf26a0 /Python/Python-ast.c | |
parent | 48e484fdde4295c755dd3d6df6d7f1633eb17f2b (diff) | |
download | cpython-0224d4e6992fdc91d8c095c7657bfcd7ce7a07a8.zip cpython-0224d4e6992fdc91d8c095c7657bfcd7ce7a07a8.tar.gz cpython-0224d4e6992fdc91d8c095c7657bfcd7ce7a07a8.tar.bz2 |
accept bytes for the AST 'string' type
This is a temporary kludge and all is well in 3.3.
Diffstat (limited to 'Python/Python-ast.c')
-rw-r--r-- | Python/Python-ast.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/Python/Python-ast.c b/Python/Python-ast.c index 8ba06ff..89c07cd 100644 --- a/Python/Python-ast.c +++ b/Python/Python-ast.c @@ -611,7 +611,7 @@ static int obj2ast_identifier(PyObject* obj, PyObject** out, PyArena* arena) static int obj2ast_string(PyObject* obj, PyObject** out, PyArena* arena) { - if (!PyUnicode_CheckExact(obj)) { + if (!PyUnicode_CheckExact(obj) && !PyBytes_CheckExact(obj)) { PyErr_SetString(PyExc_TypeError, "AST string must be of type str"); return 1; } |