mirror of
https://github.com/python/cpython.git
synced 2025-10-15 03:10:29 +00:00
gh-126209: Fix inconsistency of skip_file_prefixes
in warnings.warn
's C and Python implementations (GH-126329)
Co-authored-by: Terry Jan Reedy <tjreedy@udel.edu> Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com> Co-authored-by: Kirill Podoprigora <kirill.bast9@mail.ru>
This commit is contained in:
parent
f223efb2a2
commit
0ef84b0e2b
4 changed files with 23 additions and 5 deletions
|
@ -803,7 +803,8 @@ is_filename_to_skip(PyObject *filename, PyTupleObject *skip_file_prefixes)
|
|||
for (Py_ssize_t idx = 0; idx < prefixes; ++idx)
|
||||
{
|
||||
PyObject *prefix = PyTuple_GET_ITEM(skip_file_prefixes, idx);
|
||||
Py_ssize_t found = PyUnicode_Tailmatch(filename, prefix, 0, -1, -1);
|
||||
Py_ssize_t found = PyUnicode_Tailmatch(filename, prefix,
|
||||
0, PY_SSIZE_T_MAX, -1);
|
||||
if (found == 1) {
|
||||
return true;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue