Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit b8bff3f

Browse files
committed
Return bools from functions named is_<whatever>().
1 parent 8fdc75b commit b8bff3f

1 file changed

Lines changed: 4 additions & 4 deletions

File tree

Python/import.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -214,9 +214,9 @@ imp_lock_held(PyObject *self, PyObject *args)
214214
if (!PyArg_ParseTuple(args, ":lock_held"))
215215
return NULL;
216216
#ifdef WITH_THREAD
217-
return PyInt_FromLong(import_lock_thread != -1);
217+
return PyBool_FromLong(import_lock_thread != -1);
218218
#else
219-
return PyInt_FromLong(0);
219+
return PyBool_FromLong(0);
220220
#endif
221221
}
222222

@@ -2295,7 +2295,7 @@ imp_is_builtin(PyObject *self, PyObject *args)
22952295
char *name;
22962296
if (!PyArg_ParseTuple(args, "s:is_builtin", &name))
22972297
return NULL;
2298-
return PyInt_FromLong(is_builtin(name));
2298+
return PyBool_FromLong(is_builtin(name));
22992299
}
23002300

23012301
static PyObject *
@@ -2306,7 +2306,7 @@ imp_is_frozen(PyObject *self, PyObject *args)
23062306
if (!PyArg_ParseTuple(args, "s:is_frozen", &name))
23072307
return NULL;
23082308
p = find_frozen(name);
2309-
return PyInt_FromLong((long) (p == NULL ? 0 : p->size));
2309+
return PyBool_FromLong((long) (p == NULL ? 0 : p->size));
23102310
}
23112311

23122312
static FILE *

0 commit comments

Comments
 (0)