~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/commands.py

  • Committer: Aaron Bentley
  • Date: 2005-10-19 17:53:31 UTC
  • mfrom: (0.2.1)
  • mto: (1185.25.1)
  • mto: This revision was merged to the branch mainline in revision 1474.
  • Revision ID: abentley@panoramicfeedback.com-20051019175331-77ee21c8dc29d9ee
Prevented display commands from printing broken pipe errors

Show diffs side-by-side

added added

removed removed

Lines of Context:
31
31
import os
32
32
from warnings import warn
33
33
from inspect import getdoc
 
34
import errno
34
35
 
35
36
import bzrlib
36
37
import bzrlib.trace
499
500
        ret = cmd_obj.run_argv(argv)
500
501
    return ret or 0
501
502
 
 
503
def display_command(func):
 
504
    def ignore_pipe(*args, **kwargs):
 
505
        try:
 
506
            func(*args, **kwargs)
 
507
        except IOError, e:
 
508
            if e.errno != errno.EPIPE:
 
509
                raise
 
510
    return ignore_pipe
502
511
 
503
512
def main(argv):
504
513
    import bzrlib.ui