summaryrefslogtreecommitdiffstats
path: root/PC/_msi.c
diff options
context:
space:
mode:
authorBerker Peksag <berker.peksag@gmail.com>2017-11-23 14:33:12 (GMT)
committerGitHub <noreply@github.com>2017-11-23 14:33:12 (GMT)
commit4b3042900e7e8dc120408bab86642c09c9d25a5a (patch)
tree0ad2092325d91b325a83d28b1846cbe07df4ed94 /PC/_msi.c
parentae3c5c7b9e5e5ba53213e12cc100e32415d5762c (diff)
downloadcpython-4b3042900e7e8dc120408bab86642c09c9d25a5a.zip
cpython-4b3042900e7e8dc120408bab86642c09c9d25a5a.tar.gz
cpython-4b3042900e7e8dc120408bab86642c09c9d25a5a.tar.bz2
bpo-1102: View.Fetch() now returns None when it's exhausted (GH-4459)
(cherry picked from commit bdb8315c21825487b54852ff0511fb4881ea2181)
Diffstat (limited to 'PC/_msi.c')
-rw-r--r--PC/_msi.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/PC/_msi.c b/PC/_msi.c
index 2ab7e73..eab39d9 100644
--- a/PC/_msi.c
+++ b/PC/_msi.c
@@ -729,8 +729,12 @@ view_fetch(msiobj *view, PyObject*args)
int status;
MSIHANDLE result;
- if ((status = MsiViewFetch(view->h, &result)) != ERROR_SUCCESS)
+ status = MsiViewFetch(view->h, &result);
+ if (status == ERROR_NO_MORE_ITEMS) {
+ Py_RETURN_NONE;
+ } else if (status != ERROR_SUCCESS) {
return msierror(status);
+ }
return record_new(result);
}