Skip to content

Commit 70065ea

Browse files
committed
Issue #24779: Remove unused rawmode parameter to unicode_decode.
1 parent a03379a commit 70065ea

1 file changed

Lines changed: 3 additions & 6 deletions

File tree

Python/ast.c

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3938,7 +3938,7 @@ decode_utf8(struct compiling *c, const char **sPtr, const char *end)
39383938
}
39393939

39403940
static PyObject *
3941-
decode_unicode(struct compiling *c, const char *s, size_t len, int rawmode, const char *encoding)
3941+
decode_unicode(struct compiling *c, const char *s, size_t len, const char *encoding)
39423942
{
39433943
PyObject *v, *u;
39443944
char *buf;
@@ -3994,10 +3994,7 @@ decode_unicode(struct compiling *c, const char *s, size_t len, int rawmode, cons
39943994
len = p - buf;
39953995
s = buf;
39963996
}
3997-
if (rawmode)
3998-
v = PyUnicode_DecodeRawUnicodeEscape(s, len, NULL);
3999-
else
4000-
v = PyUnicode_DecodeUnicodeEscape(s, len, NULL);
3997+
v = PyUnicode_DecodeUnicodeEscape(s, len, NULL);
40013998
Py_XDECREF(u);
40023999
return v;
40034000
}
@@ -4896,7 +4893,7 @@ parsestr(struct compiling *c, const node *n, int *bytesmode, int *fmode)
48964893
}
48974894
}
48984895
if (!*bytesmode && !rawmode) {
4899-
return decode_unicode(c, s, len, rawmode, c->c_encoding);
4896+
return decode_unicode(c, s, len, c->c_encoding);
49004897
}
49014898
if (*bytesmode) {
49024899
/* Disallow non-ascii characters (but not escapes) */

0 commit comments

Comments
 (0)