summaryrefslogtreecommitdiffstats
path: root/PC/_msi.c
diff options
context:
space:
mode:
authorMartin v. Löwis <martin@v.loewis.de>2007-12-04 22:10:37 (GMT)
committerMartin v. Löwis <martin@v.loewis.de>2007-12-04 22:10:37 (GMT)
commitd1a1d1ed802187cd1a9a8a95ac5d758c7acffee6 (patch)
tree17489e6ea4df32ba3b3bbda6e4b31155a460f265 /PC/_msi.c
parent0fbab7ff8d2efd92e222fcc13c0aff0998c3c158 (diff)
downloadcpython-d1a1d1ed802187cd1a9a8a95ac5d758c7acffee6.zip
cpython-d1a1d1ed802187cd1a9a8a95ac5d758c7acffee6.tar.gz
cpython-d1a1d1ed802187cd1a9a8a95ac5d758c7acffee6.tar.bz2
Remove PyInt_CheckExact. Add PyLong_AsLongAndOverflow.
Diffstat (limited to 'PC/_msi.c')
-rw-r--r--PC/_msi.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/PC/_msi.c b/PC/_msi.c
index 8dc7734..80c3cae 100644
--- a/PC/_msi.c
+++ b/PC/_msi.c
@@ -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;