Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions Lib/test/test_msilib.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,13 @@ def test_database_create_failed(self):
msilib.OpenDatabase(db_path, msilib.MSIDBOPEN_CREATE)
self.assertEqual(str(cm.exception), 'create failed')

def test_get_property_vt_empty(self):
db, db_path = init_database()
summary = db.GetSummaryInformation(0)
self.assertIsNone(summary.GetProperty(msilib.PID_SECURITY))
db.Close()
self.addCleanup(unlink, db_path)


class Test_make_id(unittest.TestCase):
#http://msdn.microsoft.com/en-us/library/aa369212(v=vs.85).aspx
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
Make :meth:`msilib.SummaryInformation.GetProperty` return ``None`` when the
value of property is ``VT_EMPTY``. Initial patch by Mark Mc Mahon.
2 changes: 2 additions & 0 deletions PC/_msi.c
Original file line number Diff line number Diff line change
Expand Up @@ -575,6 +575,8 @@ summary_getproperty(msiobj* si, PyObject *args)
if (sval != sbuf)
free(sval);
return result;
case VT_EMPTY:
Py_RETURN_NONE;
}
PyErr_Format(PyExc_NotImplementedError, "result of type %d", type);
return NULL;
Expand Down