[Git][NTPsec/ntpsec][master] Massage shutil.get_terminal_size()'s os.terminal_size tuple into TermSize

Eric S. Raymond gitlab at mg.gitlab.com
Sat Dec 3 05:49:23 UTC 2016


Eric S. Raymond pushed to branch master at NTPsec / ntpsec


Commits:
d76f3519 by Matt Selsky at 2016-12-03T00:45:54-05:00
Massage shutil.get_terminal_size()'s os.terminal_size tuple into TermSize

os.terminal_size's members are columns, lines so we save to a new version and
then stuff them into TermSize

Fixes GitLab issue #185

- - - - -


1 changed file:

- pylib/util.py


Changes:

=====================================
pylib/util.py
=====================================
--- a/pylib/util.py
+++ b/pylib/util.py
@@ -72,7 +72,8 @@ def termsize():
     if not os.isatty(1):
         size = (80, 24)
     try:
-        size = shutil.get_terminal_size((80, 24))
+        (w, h) = shutil.get_terminal_size((80, 24))
+        size = (w, h)
     except AttributeError:
         # OK, Python version < 3.3, cope
         import fcntl, termios, struct



View it on GitLab: https://gitlab.com/NTPsec/ntpsec/commit/d76f35196b82ad6bb5c0a29920aac2765c63c9f3
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.ntpsec.org/pipermail/vc/attachments/20161203/dd7e8c31/attachment.html>


More information about the vc mailing list