bpo-39522: Use _PyUnicodeWriter_WriteStr instead of PyUnicode_AS_DATA (GH-19523)
This commit is contained in:
parent
4c0a31fb08
commit
43aeefa419
|
@ -875,8 +875,10 @@ append_ast_expr(_PyUnicodeWriter *writer, expr_ty e, int level)
|
|||
if (e->v.Constant.value == Py_Ellipsis) {
|
||||
APPEND_STR_FINISH("...");
|
||||
}
|
||||
APPEND_STR_IF(e->v.Constant.kind != NULL,
|
||||
PyUnicode_AS_DATA(e->v.Constant.kind));
|
||||
if (e->v.Constant.kind != NULL
|
||||
&& -1 == _PyUnicodeWriter_WriteStr(writer, e->v.Constant.kind)) {
|
||||
return -1;
|
||||
}
|
||||
return append_ast_constant(writer, e->v.Constant.value);
|
||||
case JoinedStr_kind:
|
||||
return append_joinedstr(writer, e, false);
|
||||
|
|
Loading…
Reference in New Issue