summaryrefslogtreecommitdiffstats
path: root/PC
diff options
context:
space:
mode:
authorBerker Peksag <berker.peksag@gmail.com>2017-11-23 12:47:30 (GMT)
committerGitHub <noreply@github.com>2017-11-23 12:47:30 (GMT)
commitbdb8315c21825487b54852ff0511fb4881ea2181 (patch)
tree4eed171f1a04b3742b63d4a2d34cd5ef063ff139 /PC
parent5ce1069a6ff0d5443074d33ba1d403ccd2eaf3d3 (diff)
downloadcpython-bdb8315c21825487b54852ff0511fb4881ea2181.zip
cpython-bdb8315c21825487b54852ff0511fb4881ea2181.tar.gz
cpython-bdb8315c21825487b54852ff0511fb4881ea2181.tar.bz2
bpo-1102: View.Fetch() now returns None when it's exhausted (GH-4459)
Diffstat (limited to 'PC')
-rw-r--r--PC/_msi.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/PC/_msi.c b/PC/_msi.c
index df6c881..a6a12e2 100644
--- a/PC/_msi.c
+++ b/PC/_msi.c
@@ -723,8 +723,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);
}