summaryrefslogtreecommitdiff
path: root/PC/_msi.c
diff options
context:
space:
mode:
authorMartin v. Löwis <martin@v.loewis.de>2007-12-04 22:10:37 +0000
committerMartin v. Löwis <martin@v.loewis.de>2007-12-04 22:10:37 +0000
commitfa2bc728a4b66cf93192dab05b0422874093b257 (patch)
tree9255f32d384a51f8d8c6d0eb152c5bbf67ddb1aa /PC/_msi.c
parentee4c1b8e23875dc013936922550518fb655b27fa (diff)
downloadcpython-fa2bc728a4b66cf93192dab05b0422874093b257.tar.gz
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 8dc77344c4..80c3cae9a4 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;