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