mirror of
https://github.com/python/cpython.git
synced 2025-11-02 03:01:58 +00:00
Remove PyInt_CheckExact. Add PyLong_AsLongAndOverflow.
This commit is contained in:
parent
0fbab7ff8d
commit
d1a1d1ed80
15 changed files with 134 additions and 54 deletions
|
|
@ -542,9 +542,13 @@ summary_setproperty(msiobj* si, PyObject *args)
|
|||
if (PyString_Check(data)) {
|
||||
status = MsiSummaryInfoSetProperty(si->h, field, VT_LPSTR,
|
||||
0, NULL, PyString_AsString(data));
|
||||
} else if (PyInt_CheckExact(data)) {
|
||||
} else if (PyLong_CheckExact(data)) {
|
||||
long value = PyLong_AsLong(data);
|
||||
if (value == -1 && PyErr_Occurred()) {
|
||||
return NULL;
|
||||
}
|
||||
status = MsiSummaryInfoSetProperty(si->h, field, VT_I4,
|
||||
PyLong_AsLong(data), NULL, NULL);
|
||||
value, NULL, NULL);
|
||||
} else {
|
||||
PyErr_SetString(PyExc_TypeError, "unsupported type");
|
||||
return NULL;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue