Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

python: neutralize error check for kvsitr #4

Merged
merged 1 commit into from
Aug 31, 2015
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
2 changes: 2 additions & 0 deletions src/bindings/python/flux/kvs.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@ class KVSWrapper(Wrapper):
pass

_raw = KVSWrapper(ffi, lib, prefixes=['kvs', 'kvs_'])
# override error check behavior for kvsitr_next
_raw.kvsitr_next.set_error_check(lambda x: False)


def get_key_direct(flux_handle, key):
Expand Down
3 changes: 3 additions & 0 deletions src/bindings/python/flux/wrapper.py
Original file line number Diff line number Diff line change
Expand Up @@ -130,6 +130,9 @@ def __init__(self, fun, name, t, ffi, add_handle=False):
'long long', 'int32_t', 'int64_t')]:
self.is_error = lambda x: x < 0

def set_error_check(self, fun):
self.is_error = fun

def build_argument_translation_list(self, t):
alist = t.args[1:] if self.add_handle else t.args
for i, a in enumerate(alist, start=1 if self.add_handle else 0):
Expand Down