Rev 4766: (jam, vila) More complete fix for terminal_width in file:///home/pqm/archives/thelove/bzr/%2Btrunk/
Canonical.com Patch Queue Manager
pqm at pqm.ubuntu.com
Thu Oct 22 17:27:23 BST 2009
At file:///home/pqm/archives/thelove/bzr/%2Btrunk/
------------------------------------------------------------
revno: 4766 [merge]
revision-id: pqm at pqm.ubuntu.com-20091022162721-r0to3zua8p8oprq1
parent: pqm at pqm.ubuntu.com-20091022150452-ii7isyvx3j3jsvm5
parent: v.ladeuil+lp at free.fr-20091022152103-2yoxaspv9rzn1809
committer: Canonical.com Patch Queue Manager <pqm at pqm.ubuntu.com>
branch nick: +trunk
timestamp: Thu 2009-10-22 17:27:21 +0100
message:
(jam, vila) More complete fix for terminal_width
modified:
bzrlib/osutils.py osutils.py-20050309040759-eeaff12fbf77ac86
=== modified file 'bzrlib/osutils.py'
--- a/bzrlib/osutils.py 2009-10-22 08:40:35 +0000
+++ b/bzrlib/osutils.py 2009-10-22 15:19:59 +0000
@@ -1296,7 +1296,8 @@
def terminal_width():
"""Return estimated terminal width."""
- if getattr(sys.stdout, 'isatty', None) is None:
+ isatty = getattr(sys.stdout, 'isatty', None)
+ if isatty is None or not isatty():
# If it's not a tty, the width makes no sense. We just use a value bug
# enough to avoid truncations. When the output is redirected, the
# pagers can then handle that themselves. A cleaner implementation
More information about the bazaar-commits
mailing list