diff options
-rwxr-xr-x | bin/ebuild-ipc.py | 26 |
1 files changed, 15 insertions, 11 deletions
diff --git a/bin/ebuild-ipc.py b/bin/ebuild-ipc.py index 5569a24b5..21e5647f3 100755 --- a/bin/ebuild-ipc.py +++ b/bin/ebuild-ipc.py @@ -94,23 +94,27 @@ class EbuildIpc(object): except IOError as e: portage.util.writemsg("%s\n" % (e,), noiselevel=-1) - if buf: + rval = 2 - reply = pickle.loads(buf.tostring()) - output_file.close() - input_file.close() + if buf: - (out, err, rval) = reply + try: + reply = pickle.loads(buf.tostring()) + except (EnvironmentError, EOFError, ValueError, + pickle.UnpicklingError) as e: + portage.util.writemsg("%s\n" % (e,), noiselevel=-1) - if out: - portage.util.writemsg_stdout(out, noiselevel=-1) + else: + output_file.close() + input_file.close() - if err: - portage.util.writemsg(err, noiselevel=-1) + (out, err, rval) = reply - else: + if out: + portage.util.writemsg_stdout(out, noiselevel=-1) - rval = 2 + if err: + portage.util.writemsg(err, noiselevel=-1) return rval |