summaryrefslogtreecommitdiff
path: root/Objects/interpreteridobject.c
diff options
context:
space:
mode:
authorVictor Stinner <vstinner@python.org>2020-04-08 02:01:56 +0200
committerGitHub <noreply@github.com>2020-04-08 02:01:56 +0200
commita15e260b708a98edaba86a2aa663c3f6b2abc964 (patch)
treeac80e678c0266db42f8264a1fccfdeb1f58f6a17 /Objects/interpreteridobject.c
parent45ec5b99aefa54552947049086e87ec01bc2fc9a (diff)
downloadcpython-git-a15e260b708a98edaba86a2aa663c3f6b2abc964.tar.gz
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/interpreteridobject.c')
-rw-r--r--Objects/interpreteridobject.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/Objects/interpreteridobject.c b/Objects/interpreteridobject.c
index 57748e8139..3f316873ed 100644
--- a/Objects/interpreteridobject.c
+++ b/Objects/interpreteridobject.c
@@ -1,7 +1,8 @@
/* InterpreterID object */
#include "Python.h"
-#include "internal/pycore_pystate.h"
+#include "pycore_abstract.h" // _PyIndex_Check()
+#include "pycore_pystate.h"
#include "interpreteridobject.h"
@@ -42,7 +43,7 @@ interp_id_converter(PyObject *arg, void *ptr)
if (PyObject_TypeCheck(arg, &_PyInterpreterID_Type)) {
id = ((interpid *)arg)->id;
}
- else if (PyIndex_Check(arg)) {
+ else if (_PyIndex_Check(arg)) {
id = PyLong_AsLongLong(arg);
if (id == -1 && PyErr_Occurred()) {
return 0;