mirror of
https://github.com/python/cpython.git
synced 2025-10-10 00:43:41 +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
|
@ -2303,7 +2303,7 @@ test_c_api(PySetObject *so)
|
|||
/* Exercise direct iteration */
|
||||
i = 0, count = 0;
|
||||
while (_PySet_Next((PyObject *)dup, &i, &x)) {
|
||||
s = PyString_AsString(x);
|
||||
s = PyUnicode_AsString(x);
|
||||
assert(s && (s[0] == 'a' || s[0] == 'b' || s[0] == 'c'));
|
||||
count++;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue