diff options
author | Martin v. Löwis <martin@v.loewis.de> | 2007-12-04 22:10:37 (GMT) |
---|---|---|
committer | Martin v. Löwis <martin@v.loewis.de> | 2007-12-04 22:10:37 (GMT) |
commit | d1a1d1ed802187cd1a9a8a95ac5d758c7acffee6 (patch) | |
tree | 17489e6ea4df32ba3b3bbda6e4b31155a460f265 /PC | |
parent | 0fbab7ff8d2efd92e222fcc13c0aff0998c3c158 (diff) | |
download | cpython-d1a1d1ed802187cd1a9a8a95ac5d758c7acffee6.zip cpython-d1a1d1ed802187cd1a9a8a95ac5d758c7acffee6.tar.gz cpython-d1a1d1ed802187cd1a9a8a95ac5d758c7acffee6.tar.bz2 |
Remove PyInt_CheckExact. Add PyLong_AsLongAndOverflow.
Diffstat (limited to 'PC')
-rw-r--r-- | PC/_msi.c | 8 |
1 files changed, 6 insertions, 2 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; |