handle Int and Long types

This commit is contained in:
Doug MacEachern 2007-09-09 21:53:06 +00:00
parent 83575cdb58
commit ec14009bee
1 changed files with 9 additions and 1 deletions

View File

@ -104,7 +104,15 @@ static int pysigar_parse_uint64(PyObject *args, sigar_uint64_t *val)
return !SIGAR_OK; return !SIGAR_OK;
} }
if (PyInt_Check(obj)) {
*val = PyInt_AsUnsignedLongLongMask(obj); *val = PyInt_AsUnsignedLongLongMask(obj);
}
else if (PyLong_Check(obj)) {
*val = PyLong_AsUnsignedLongLong(obj);
}
else {
return !SIGAR_OK;
}
return SIGAR_OK; return SIGAR_OK;
} }