~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/osutils.py

  • Committer: Canonical.com Patch Queue Manager
  • Date: 2009-10-23 17:30:42 UTC
  • mfrom: (4766.1.1 integration)
  • Revision ID: pqm@pqm.ubuntu.com-20091023173042-6bbukn561ie0a6hb
Revert incomplete fix for bug #353370

Show diffs side-by-side

added added

removed removed

Lines of Context:
1296
1296
 
1297
1297
def terminal_width():
1298
1298
    """Return estimated terminal width."""
1299
 
    isatty = getattr(sys.stdout, 'isatty', None)
1300
 
    if  isatty is None or not isatty():
1301
 
        # If it's not a tty, the width makes no sense. We just use a value bug
1302
 
        # enough to avoid truncations. When the output is redirected, the
1303
 
        # pagers can then handle that themselves. A cleaner implementation
1304
 
        # would be to fix the callers to not try to format at all in these
1305
 
        # circumstances.
1306
 
        return 65536
1307
 
 
1308
1299
    if sys.platform == 'win32':
1309
1300
        return win32utils.get_console_size()[0]
1310
1301
    width = 0