aboutsummaryrefslogtreecommitdiffstats
path: root/contrib/tools/python3/Python/ast_unparse.c
diff options
context:
space:
mode:
authorAlexander Smirnov <alex@ydb.tech>2024-10-28 20:34:11 +0000
committerAlexander Smirnov <alex@ydb.tech>2024-10-28 20:34:11 +0000
commitef9875b11a33dbd25e92bc6b4cf692c18c9ba0ce (patch)
tree1f2fd4e4d9e585da35937b42fbda5f854af04728 /contrib/tools/python3/Python/ast_unparse.c
parent37ae9cc90160b53eb0e22021c47b3996a01cd656 (diff)
parente3c8507a3d1cb090278f211232ddfde3bedc54d4 (diff)
downloadydb-ef9875b11a33dbd25e92bc6b4cf692c18c9ba0ce.tar.gz
Merge branch 'rightlib' into mergelibs-241028-2033
Diffstat (limited to 'contrib/tools/python3/Python/ast_unparse.c')
-rw-r--r--contrib/tools/python3/Python/ast_unparse.c10
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 = "{ ";