From 8e78ed3b92f5937738d75715842b14dc88b45a61 Mon Sep 17 00:00:00 2001 From: Mehdi Abaakouk Date: Mon, 28 Mar 2016 15:38:45 +0200 Subject: [PATCH] pybinding: python3 fixes This fixes a couple of issues to make test_rados.py passed again against python 3 Signed-off-by: Mehdi Abaakouk --- src/pybind/rados/rados.pyx | 2 +- src/test/pybind/test_rados.py | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/pybind/rados/rados.pyx b/src/pybind/rados/rados.pyx index 86a4cb8967b..1f2a049a68a 100644 --- a/src/pybind/rados/rados.pyx +++ b/src/pybind/rados/rados.pyx @@ -2025,7 +2025,7 @@ cdef class Ioctx(object): :raises: IoctxStateError """ - if self.state != b"open": + if self.state != "open": raise IoctxStateError("The pool is %s" % self.state) def change_auid(self, auid): diff --git a/src/test/pybind/test_rados.py b/src/test/pybind/test_rados.py index c1ce5fc6ebc..cfa5b88564a 100644 --- a/src/test/pybind/test_rados.py +++ b/src/test/pybind/test_rados.py @@ -448,12 +448,12 @@ class TestIoctx(object): with ReadOpCtx(self.ioctx) as read_op: iter, ret = self.ioctx.get_omap_vals(read_op, "", "", 4) self.ioctx.operate_read_op(read_op, "hw") - iter.next() + next(iter) eq(list(iter), [("2", b"bbb"), ("3", b"ccc"), ("4", b"\x04\x04\x04\x04")]) with ReadOpCtx(self.ioctx) as read_op: iter, ret = self.ioctx.get_omap_vals(read_op, "2", "", 4) self.ioctx.operate_read_op(read_op, "hw") - eq(("3", b"ccc"), iter.next()) + eq(("3", b"ccc"), next(iter)) eq(list(iter), [("4", b"\x04\x04\x04\x04")]) with ReadOpCtx(self.ioctx) as read_op: iter, ret = self.ioctx.get_omap_vals(read_op, "", "2", 4) -- 2.47.3