diff options
author | shadchin <shadchin@yandex-team.com> | 2024-10-27 10:52:33 +0300 |
---|---|---|
committer | shadchin <shadchin@yandex-team.com> | 2024-10-27 11:03:47 +0300 |
commit | 1529383373617c6d14ad4972afdc46a5eb35f954 (patch) | |
tree | 229b7647fafadd4ee4b93d20e606c534ad697365 /contrib/tools/python3/Python/ast_unparse.c | |
parent | 41d598c624442bf6918407466dac3316b8277347 (diff) | |
download | ydb-1529383373617c6d14ad4972afdc46a5eb35f954.tar.gz |
Update Python 3 to 3.12.7
commit_hash:052a122399d67f1ea5dfbc5f6457e3e06200becf
Diffstat (limited to 'contrib/tools/python3/Python/ast_unparse.c')
-rw-r--r-- | contrib/tools/python3/Python/ast_unparse.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/contrib/tools/python3/Python/ast_unparse.c b/contrib/tools/python3/Python/ast_unparse.c index 8aff045101..10e9d9b710 100644 --- a/contrib/tools/python3/Python/ast_unparse.c +++ b/contrib/tools/python3/Python/ast_unparse.c @@ -10,9 +10,7 @@ * See ast.unparse for a full unparser (written in Python) */ -_Py_DECLARE_STR(open_br, "{"); _Py_DECLARE_STR(dbl_open_br, "{{"); -_Py_DECLARE_STR(close_br, "}"); _Py_DECLARE_STR(dbl_close_br, "}}"); /* We would statically initialize this if doing so were simple enough. */ @@ -580,11 +578,13 @@ escape_braces(PyObject *orig) { PyObject *temp; PyObject *result; - temp = PyUnicode_Replace(orig, &_Py_STR(open_br), &_Py_STR(dbl_open_br), -1); + temp = PyUnicode_Replace(orig, _Py_LATIN1_CHR('{'), + &_Py_STR(dbl_open_br), -1); if (!temp) { return NULL; } - result = PyUnicode_Replace(temp, &_Py_STR(close_br), &_Py_STR(dbl_close_br), -1); + result = PyUnicode_Replace(temp, _Py_LATIN1_CHR('}'), + &_Py_STR(dbl_close_br), -1); Py_DECREF(temp); return result; } @@ -678,7 +678,7 @@ append_formattedvalue(_PyUnicodeWriter *writer, expr_ty e) if (!temp_fv_str) { return -1; } - if (PyUnicode_Find(temp_fv_str, &_Py_STR(open_br), 0, 1, 1) == 0) { + if (PyUnicode_Find(temp_fv_str, _Py_LATIN1_CHR('{'), 0, 1, 1) == 0) { /* Expression starts with a brace, split it with a space from the outer one. */ outer_brace = "{ "; |