summaryrefslogtreecommitdiffstats
path: root/PC/_msi.c
diff options
context:
space:
mode:
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;