From: Javeme Date: Tue, 18 Oct 2016 12:54:24 +0000 (+0800) Subject: pybind: return a tuple in run_in_thread() if interrupted X-Git-Tag: v11.1.0~529^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=ce0d9e41feccce3ff05f9ac5d8fccd110dca42b3;p=ceph.git pybind: return a tuple in run_in_thread() if interrupted Callers expect run_in_thread() to return a tuple, but it returns an int. When interrupt the function it would raise an iterable exception. This patch fix the bug, and it would just output a message like: "Error EINTR: Interrupted!" Signed-off-by: Javeme --- diff --git a/src/pybind/ceph_argparse.py b/src/pybind/ceph_argparse.py index c3aef846e19e..b60e71fb1b57 100644 --- a/src/pybind/ceph_argparse.py +++ b/src/pybind/ceph_argparse.py @@ -1191,7 +1191,7 @@ def run_in_thread(target, *args, **kwargs): interrupt = True if interrupt: - t.retval = -errno.EINTR + t.retval = -errno.EINTR, None, 'Interrupted!' if t.exception: raise t.exception return t.retval