From bc091ed91f3a6a009dc13fe402611005b69f3611 Mon Sep 17 00:00:00 2001 From: Hector Martin Date: Thu, 3 Dec 2015 03:07:02 +0900 Subject: [PATCH] pybind/rbd.pyx: only set self.closed after a successful close Signed-off-by: Hector Martin --- src/pybind/rbd.pyx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/pybind/rbd.pyx b/src/pybind/rbd.pyx index c2762ccbd2e90..14f33014c0cf8 100644 --- a/src/pybind/rbd.pyx +++ b/src/pybind/rbd.pyx @@ -644,12 +644,12 @@ cdef class Image(object): After this is called, this object should not be used. """ if not self.closed: - self.closed = True with nogil: ret = rbd_close(self.image) if ret < 0: raise make_ex(ret, 'error while closing image %s' % ( self.name,)) + self.closed = True def __del__(self): self.close() -- 2.39.5