python: bulk port tdb iterkeys for py3
authorJoe Guo <joeg@catalyst.net.nz>
Thu, 12 Apr 2018 04:07:24 +0000 (16:07 +1200)
committerDouglas Bagnall <dbagnall@samba.org>
Fri, 13 Apr 2018 05:27:12 +0000 (07:27 +0200)
commit2892293182f282336f08ed17315ae744aa72bddc
tree229c3e6479beb4d0e8d263a52d5d164238afa5cc
parentf3b52875388da6e064567621a53e9ccb508dc6d5
python: bulk port tdb iterkeys for py3

In py3, `dict.iterkeys()` is removed, we need to use `keys()` instead.
This is compatible with py2 since `dict.keys()` exists for py2.

tdb pretents to be a dict, however, not completely.
It provides `iterkeys()` for py2 only, and `keys()` for py3 only,
which means replace `iterkeys()` to `keys()` will break py2.

In python, iter a dict will implicitly iter on keys.
Use this feature to work around.

Signed-off-by: Joe Guo <joeg@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
python/samba/samba3/__init__.py