Skip to content

Commit 94371bd

Browse files
committed
Fix debug specifier segfault
1 parent 17014e7 commit 94371bd

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

Parser/action_helpers.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1490,8 +1490,9 @@ expr_ty _PyPegen_interpolation(Parser *p, expr_ty expression, Token *debug, Resu
14901490
constant convstr = NULL;
14911491
int conversion_val = _get_interpolation_conversion(p, debug, conversion, format);
14921492
if (conversion_val >= 0) {
1493-
expr_ty conv = (expr_ty) conversion->result;
1494-
convstr = _PyUnicode_Copy(conv->v.Name.id);
1493+
char buf[1];
1494+
buf[0] = conversion_val;
1495+
convstr = PyUnicode_FromStringAndSize(buf, 1);
14951496
if (convstr == NULL) {
14961497
return NULL;
14971498
}

0 commit comments

Comments
 (0)