From 0224d4e6992fdc91d8c095c7657bfcd7ce7a07a8 Mon Sep 17 00:00:00 2001 From: Benjamin Peterson Date: Wed, 31 Aug 2011 22:13:03 -0400 Subject: accept bytes for the AST 'string' type This is a temporary kludge and all is well in 3.3. --- Python/Python-ast.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'Python/Python-ast.c') 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; } -- cgit v1.2.1