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
commitfceeee47d9cd9eef2f01ebd782e2a3face38be15 (patch)
tree74f83bcac17d6f77051d9f4374445b91f8b780d2 /Python/Python-ast.c
parentbafafcd5eda9b55c750929f57841fa5cb0a95062 (diff)
downloadcpython-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 '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;
}