Skip to content

Commit 3c78173

Browse files
committed
Update
1 parent 6bc3973 commit 3c78173

File tree

2 files changed

+21
-6
lines changed

2 files changed

+21
-6
lines changed

Modules/_testcapi/clinic/long.c.h

Lines changed: 9 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Modules/_testcapi/long.c

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -566,14 +566,21 @@ _testcapi_test_long_numbits_impl(PyObject *module)
566566
Py_RETURN_NONE;
567567
}
568568

569+
/*[clinic input]
570+
_testcapi.call_long_compact_api as check_long_compact_api
571+
obj: object
572+
/
573+
[clinic start generated code]*/
574+
569575
static PyObject *
570-
check_long_compact_api(PyObject *self, PyObject *arg)
576+
check_long_compact_api(PyObject *module, PyObject *obj)
577+
/*[clinic end generated code: output=32e2540a75da5702 input=7e7dcce231d655e1]*/
571578
{
572-
assert(PyLong_Check(arg));
573-
int is_compact = PyUnstable_Long_IsCompact((PyLongObject*)arg);
579+
assert(PyLong_Check(obj));
580+
int is_compact = PyUnstable_Long_IsCompact((PyLongObject*)obj);
574581
Py_ssize_t value = -1;
575582
if (is_compact) {
576-
value = PyUnstable_Long_CompactValue((PyLongObject*)arg);
583+
value = PyUnstable_Long_CompactValue((PyLongObject*)obj);
577584
}
578585
return Py_BuildValue("in", is_compact, value);
579586
}
@@ -587,7 +594,7 @@ static PyMethodDef test_methods[] = {
587594
_TESTCAPI_TEST_LONG_LONG_AND_OVERFLOW_METHODDEF
588595
_TESTCAPI_TEST_LONG_NUMBITS_METHODDEF
589596
_TESTCAPI_TEST_LONGLONG_API_METHODDEF
590-
{"call_long_compact_api", check_long_compact_api, METH_O},
597+
CHECK_LONG_COMPACT_API_METHODDEF
591598
{NULL},
592599
};
593600

0 commit comments

Comments
 (0)