From ce0d9e41feccce3ff05f9ac5d8fccd110dca42b3 Mon Sep 17 00:00:00 2001 From: Javeme Date: Tue, 18 Oct 2016 20:54:24 +0800 Subject: [PATCH] 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 --- src/pybind/ceph_argparse.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/pybind/ceph_argparse.py b/src/pybind/ceph_argparse.py index c3aef846e19e6..b60e71fb1b570 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 -- 2.39.5