summaryrefslogtreecommitdiff
path: root/Python/Python-ast.c
diff options
context:
space:
mode:
authorBenjamin Peterson <benjamin@python.org>2011-08-31 22:13:03 -0400
committerBenjamin Peterson <benjamin@python.org>2011-08-31 22:13:03 -0400
commit8517c9174252c7e4419fdb11636680a6b90eaf37 (patch)
tree5f3fb77405625b01e53bf4292cb27902c135207e /Python/Python-ast.c
parent5e5a43b329270f50dacb02ee9f6f40afcfacb8a5 (diff)
downloadcpython-8517c9174252c7e4419fdb11636680a6b90eaf37.tar.gz
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.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/Python/Python-ast.c b/Python/Python-ast.c
index 8ba06ff39a..89c07cd602 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;
}