accept bytes for the AST 'string' type
This is a temporary kludge and all is well in 3.3.
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user