diff options
author | Victor Stinner <vstinner@python.org> | 2020-04-08 00:01:56 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-04-08 00:01:56 (GMT) |
commit | a15e260b708a98edaba86a2aa663c3f6b2abc964 (patch) | |
tree | ac80e678c0266db42f8264a1fccfdeb1f58f6a17 /Objects/bytes_methods.c | |
parent | 45ec5b99aefa54552947049086e87ec01bc2fc9a (diff) | |
download | cpython-a15e260b708a98edaba86a2aa663c3f6b2abc964.zip cpython-a15e260b708a98edaba86a2aa663c3f6b2abc964.tar.gz cpython-a15e260b708a98edaba86a2aa663c3f6b2abc964.tar.bz2 |
bpo-40170: Add _PyIndex_Check() internal function (GH-19426)
Add _PyIndex_Check() function to the internal C API: fast inlined
verson of PyIndex_Check().
Add Include/internal/pycore_abstract.h header file.
Replace PyIndex_Check() with _PyIndex_Check() in C files of Objects
and Python subdirectories.
Diffstat (limited to 'Objects/bytes_methods.c')
-rw-r--r-- | Objects/bytes_methods.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/Objects/bytes_methods.c b/Objects/bytes_methods.c index a4b3868..72daa1f 100644 --- a/Objects/bytes_methods.c +++ b/Objects/bytes_methods.c @@ -1,5 +1,6 @@ #define PY_SSIZE_T_CLEAN #include "Python.h" +#include "pycore_abstract.h" // _PyIndex_Check() #include "pycore_bytes_methods.h" PyDoc_STRVAR_shared(_Py_isspace__doc__, @@ -466,7 +467,7 @@ parse_args_finds_byte(const char *function_name, PyObject *args, return 1; } - if (!PyIndex_Check(tmp_subobj)) { + if (!_PyIndex_Check(tmp_subobj)) { PyErr_Format(PyExc_TypeError, "argument should be integer or bytes-like object, " "not '%.200s'", |