All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] backports: lib: remove raising ExecutionError exception
@ 2014-04-25 10:44 Arend van Spriel
  2014-04-26 17:20 ` Luis R. Rodriguez
  2014-04-29  9:58 ` [PATCH V2] " Arend van Spriel
  0 siblings, 2 replies; 5+ messages in thread
From: Arend van Spriel @ 2014-04-25 10:44 UTC (permalink / raw)
  To: Luis R. Rodriguez; +Cc: backports, Arend van Spriel

In spatch a ExecutionError was raised, but that causes the thread
to finish without closing the outfile and more importantly without
putting (ret, fn) tuple on the return queue. This results in the
threaded_spatch routine to get stuck on the ret_q.get() call. This
patch removes raising the ExecutionError and just return the tuple.
The non-zero return code will result in ExecutionErrorThread exception
anyway.

Signed-off-by: Arend van Spriel <arend@broadcom.com>
---
 lib/bpcoccinelle.py |    5 -----
 1 file changed, 5 deletions(-)

diff --git a/lib/bpcoccinelle.py b/lib/bpcoccinelle.py
index a71f425..fc503f1 100644
--- a/lib/bpcoccinelle.py
+++ b/lib/bpcoccinelle.py
@@ -4,9 +4,6 @@ from lib.tempdir import tempdir
 
 class CoccinelleError(Exception):
     pass
-class ExecutionError(CoccinelleError):
-    def __init__(self, errcode):
-        self.error_code = errcode
 class ExecutionErrorThread(CoccinelleError):
     def __init__(self, errcode, fn, cocci_file, threads, t, logwrite, print_name):
         self.error_code = errcode
@@ -48,8 +45,6 @@ def spatch(cocci_file, outdir,
                                close_fds=True, universal_newlines=True,
                                cwd=outdir)
     sprocess.wait()
-    if sprocess.returncode != 0:
-        raise ExecutionError(sprocess.returncode)
     outfile.close()
     ret_q.put((sprocess.returncode, fn))
 
-- 
1.7.9.5


^ permalink raw reply related	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2014-05-02  8:08 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-04-25 10:44 [PATCH] backports: lib: remove raising ExecutionError exception Arend van Spriel
2014-04-26 17:20 ` Luis R. Rodriguez
2014-04-29  9:58 ` [PATCH V2] " Arend van Spriel
2014-05-02  1:06   ` Luis R. Rodriguez
2014-05-02  8:08     ` Arend van Spriel

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.