12 #if PY_MAJOR_VERSION < 3 17 size_t PyLongOrInt_AsSize_t(PyObject *vv) {
18 if (PyInt_Check(vv)) {
19 long value = PyInt_AS_LONG(vv);
21 PyErr_SetString(PyExc_OverflowError,
22 "can't convert negative value to size_t");
28 if (!PyLong_Check(vv)) {
29 Dtool_Raise_TypeError(
"a long or int was expected");
35 int res = _PyLong_AsByteArray((PyLongObject *)vv, (
unsigned char *)&bytes,
36 SIZEOF_SIZE_T, (
int)*(
unsigned char*)&one, 0);