summaryrefslogtreecommitdiffstats
path: root/PC
diff options
context:
space:
mode:
authorZachary Ware <zachary.ware@gmail.com>2015-05-18 05:49:15 (GMT)
committerZachary Ware <zachary.ware@gmail.com>2015-05-18 05:49:15 (GMT)
commitf4e6030542eaf684a384f27a741d877c05b17b33 (patch)
tree3c01258449e722b136ec81ec2899c1d52a837062 /PC
parentc15ea4c81280d64e1a74f7e48bbff1f6dfb91860 (diff)
parent0a29e898cd9f8ca49008baba8e739422fd9276a8 (diff)
downloadcpython-f4e6030542eaf684a384f27a741d877c05b17b33.zip
cpython-f4e6030542eaf684a384f27a741d877c05b17b33.tar.gz
cpython-f4e6030542eaf684a384f27a741d877c05b17b33.tar.bz2
Closes #21931: Merge with 3.4
Diffstat (limited to 'PC')
-rw-r--r--PC/_msi.c15
1 files changed, 12 insertions, 3 deletions
diff --git a/PC/_msi.c b/PC/_msi.c
index 6a99b40..86a5943 100644
--- a/PC/_msi.c
+++ b/PC/_msi.c
@@ -243,8 +243,13 @@ static PyObject* fcicreate(PyObject* obj, PyObject* args)
for (i=0; i < PyList_GET_SIZE(files); i++) {
PyObject *item = PyList_GET_ITEM(files, i);
char *filename, *cabname;
- if (!PyArg_ParseTuple(item, "ss", &filename, &cabname))
- goto err;
+
+ if (!PyArg_ParseTuple(item, "ss", &filename, &cabname)) {
+ PyErr_SetString(PyExc_TypeError, "FCICreate expects a list of tuples containing two strings");
+ FCIDestroy(hfci);
+ return NULL;
+ }
+
if (!FCIAddFile(hfci, filename, cabname, FALSE,
cb_getnextcabinet, cb_status, cb_getopeninfo,
tcompTYPE_MSZIP))
@@ -260,7 +265,11 @@ static PyObject* fcicreate(PyObject* obj, PyObject* args)
Py_INCREF(Py_None);
return Py_None;
err:
- PyErr_Format(PyExc_ValueError, "FCI error %d", erf.erfOper); /* XXX better error type */
+ if(erf.fError)
+ PyErr_Format(PyExc_ValueError, "FCI error %d", erf.erfOper); /* XXX better error type */
+ else
+ PyErr_SetString(PyExc_ValueError, "FCI general error");
+
FCIDestroy(hfci);
return NULL;
}