summaryrefslogtreecommitdiff
path: root/cmd2.py
diff options
context:
space:
mode:
authorKevin Van Brunt <kmvanbrunt@gmail.com>2018-03-21 01:03:24 -0400
committerKevin Van Brunt <kmvanbrunt@gmail.com>2018-03-21 01:03:24 -0400
commit57e53eed70f3a317d95a0f446eaa60c24392a388 (patch)
treec20009ccfdbd1fba0619e20e26b084cec8dfc376 /cmd2.py
parentf4570b6a3c13304f12e4319b4bf97dbe4f64305d (diff)
downloadcmd2-git-57e53eed70f3a317d95a0f446eaa60c24392a388.tar.gz
shutil.get_terminal_size does not exist before Python 3.3
Diffstat (limited to 'cmd2.py')
-rwxr-xr-xcmd2.py5
1 files changed, 4 insertions, 1 deletions
diff --git a/cmd2.py b/cmd2.py
index c6f8ef3b..9cb42c89 100755
--- a/cmd2.py
+++ b/cmd2.py
@@ -1557,7 +1557,10 @@ class Cmd(cmd.Cmd):
matches.sort()
self.poutput("\n")
- num_cols = shutil.get_terminal_size().columns
+ if sys.version_info >= (3, 3):
+ num_cols = shutil.get_terminal_size().columns
+ else:
+ num_cols = 80
if matches_to_display is None:
self.columnize(matches, num_cols)