diff options
author | Benjamin Peterson <benjamin@python.org> | 2011-08-31 22:13:03 -0400 |
---|---|---|
committer | Benjamin Peterson <benjamin@python.org> | 2011-08-31 22:13:03 -0400 |
commit | fceeee47d9cd9eef2f01ebd782e2a3face38be15 (patch) | |
tree | 74f83bcac17d6f77051d9f4374445b91f8b780d2 /Parser/asdl_c.py | |
parent | bafafcd5eda9b55c750929f57841fa5cb0a95062 (diff) | |
download | cpython-fceeee47d9cd9eef2f01ebd782e2a3face38be15.tar.gz |
accept bytes for the AST 'string' type
This is a temporary kludge and all is well in 3.3.
Diffstat (limited to 'Parser/asdl_c.py')
-rwxr-xr-x | Parser/asdl_c.py | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/Parser/asdl_c.py b/Parser/asdl_c.py index 8a7f8aec7f..249e18ddf4 100755 --- a/Parser/asdl_c.py +++ b/Parser/asdl_c.py @@ -805,7 +805,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; } |