From 2fd7f5644b70ba238755eb2acec984c16303601a Mon Sep 17 00:00:00 2001 From: Guido Trotter <ultrotter@google.com> Date: Tue, 1 Jun 2010 18:14:54 +0100 Subject: [PATCH] Explicitely return None from IgnoreSignals Same result, but what happens is clearer. Signed-off-by: Guido Trotter <ultrotter@google.com> Reviewed-by: Michael Hanselmann <hansmi@google.com> --- lib/utils.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/lib/utils.py b/lib/utils.py index 2909f8664..1a8b185df 100644 --- a/lib/utils.py +++ b/lib/utils.py @@ -2519,12 +2519,16 @@ def IgnoreSignals(fn, *args, **kwargs): try: return fn(*args, **kwargs) except EnvironmentError, err: - if err.errno != errno.EINTR: + if err.errno == errno.EINTR: + return None + else: raise except (select.error, socket.error), err: # In python 2.6 and above select.error is an IOError, so it's handled # above, in 2.5 and below it's not, and it's handled here. - if not (err.args and err.args[0] == errno.EINTR): + if err.args and err.args[0] == errno.EINTR: + return None + else: raise -- GitLab