Rev 4766: More complete fix fpr terminal_width in http://bazaar.launchpad.net/~vila/bzr/integration

Vincent Ladeuil v.ladeuil+lp at free.fr
Thu Oct 22 16:21:14 BST 2009


At http://bazaar.launchpad.net/~vila/bzr/integration

------------------------------------------------------------
revno: 4766 [merge]
revision-id: v.ladeuil+lp at free.fr-20091022152103-2yoxaspv9rzn1809
parent: pqm at pqm.ubuntu.com-20091022150452-ii7isyvx3j3jsvm5
parent: v.ladeuil+lp at free.fr-20091022151959-4nk4w3g0cvt2555n
committer: Vincent Ladeuil <v.ladeuil+lp at free.fr>
branch nick: integration
timestamp: Thu 2009-10-22 17:21:03 +0200
message:
  More complete fix fpr terminal_width
modified:
  bzrlib/osutils.py              osutils.py-20050309040759-eeaff12fbf77ac86
-------------- next part --------------
=== 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