Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 6f08f53

Browse files
committed
Merge 3.2
2 parents 677dc71 + d9e1789 commit 6f08f53

2 files changed

Lines changed: 2 additions & 2 deletions

File tree

Parser/asdl_c.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -807,7 +807,7 @@ def visitModule(self, mod):
807807
808808
static int obj2ast_string(PyObject* obj, PyObject** out, PyArena* arena)
809809
{
810-
if (!PyUnicode_CheckExact(obj)) {
810+
if (!PyUnicode_CheckExact(obj) && !PyBytes_CheckExact(obj)) {
811811
PyErr_SetString(PyExc_TypeError, "AST string must be of type str");
812812
return 1;
813813
}

Python/Python-ast.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -604,7 +604,7 @@ static int obj2ast_identifier(PyObject* obj, PyObject** out, PyArena* arena)
604604

605605
static int obj2ast_string(PyObject* obj, PyObject** out, PyArena* arena)
606606
{
607-
if (!PyUnicode_CheckExact(obj)) {
607+
if (!PyUnicode_CheckExact(obj) && !PyBytes_CheckExact(obj)) {
608608
PyErr_SetString(PyExc_TypeError, "AST string must be of type str");
609609
return 1;
610610
}

0 commit comments

Comments
 (0)