diff options
author | John Parent <john.parent@kitware.com> | 2022-01-24 14:35:44 -0500 |
---|---|---|
committer | Peter Scheibel <scheibel1@llnl.gov> | 2022-03-17 09:01:01 -0700 |
commit | cf1349ba35a958e776759db7b69f54089d2638c6 (patch) | |
tree | a169c786aac015f9388ea31deb8884cdf58eb49e /lib/spack/llnl/util/tty/__init__.py | |
parent | e4d4a5193ff4ac2a19a7ae77d66df1cd085a979d (diff) | |
download | spack-cf1349ba35a958e776759db7b69f54089d2638c6.tar.gz spack-cf1349ba35a958e776759db7b69f54089d2638c6.tar.bz2 spack-cf1349ba35a958e776759db7b69f54089d2638c6.tar.xz spack-cf1349ba35a958e776759db7b69f54089d2638c6.zip |
"spack commands --update-completion"
Diffstat (limited to 'lib/spack/llnl/util/tty/__init__.py')
-rw-r--r-- | lib/spack/llnl/util/tty/__init__.py | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/lib/spack/llnl/util/tty/__init__.py b/lib/spack/llnl/util/tty/__init__.py index 5b8729d7ec..ae7634afea 100644 --- a/lib/spack/llnl/util/tty/__init__.py +++ b/lib/spack/llnl/util/tty/__init__.py @@ -394,7 +394,8 @@ def terminal_size(): return int(rc[0]), int(rc[1]) else: - # return shutil.get_terminal_size() - # TODO: find python 2 compatible module to get terminal size + if sys.version_info[0] < 3: + raise RuntimeError("""Terminal size not obtainable on Windows with a + Python version older than 3""") rc = (os.environ.get('LINES', 25), os.environ.get('COLUMNS', 80)) return int(rc[0]), int(rc[1]) |