mirror of
https://github.com/python/cpython.git
synced 2025-10-21 14:12:27 +00:00
PyString_AsString is permissive and accepts unicode strings.
Replace it with PyUnicode_AsString when the argument is known to be a str.
This commit is contained in:
parent
484fcd4521
commit
39599dca9d
5 changed files with 9 additions and 9 deletions
|
@ -1299,7 +1299,7 @@ ast_for_atom(struct compiling *c, const node *n)
|
|||
if (errstr) {
|
||||
char *s = "";
|
||||
char buf[128];
|
||||
s = PyString_AsString(errstr);
|
||||
s = PyUnicode_AsString(errstr);
|
||||
PyOS_snprintf(buf, sizeof(buf), "(unicode error) %s", s);
|
||||
ast_error(n, buf);
|
||||
} else {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue