diff options
author | Victor Stinner <victor.stinner@gmail.com> | 2016-04-19 20:24:56 (GMT) |
---|---|---|
committer | Victor Stinner <victor.stinner@gmail.com> | 2016-04-19 20:24:56 (GMT) |
commit | 119ebb70e9b7ae15896ced52321d626b757e7cbb (patch) | |
tree | 0afb3b2dbb9581847107b4d4f3491476cfefeeb6 /Lib/test | |
parent | ded4c4967b37ead4c2f897b3a0f565a02098a948 (diff) | |
download | cpython-119ebb70e9b7ae15896ced52321d626b757e7cbb.zip cpython-119ebb70e9b7ae15896ced52321d626b757e7cbb.tar.gz cpython-119ebb70e9b7ae15896ced52321d626b757e7cbb.tar.bz2 |
Fix shutil.get_terminal_size() error handling
Issue #26801: Fix error handling in shutil.get_terminal_size(), catch
AttributeError instead of NameError. Patch written by Emanuel Barry.
test_shutil: skip the functional test using "stty size" command if
os.get_terminal_size() is missing.
Diffstat (limited to 'Lib/test')
-rw-r--r-- | Lib/test/test_shutil.py | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/Lib/test/test_shutil.py b/Lib/test/test_shutil.py index ca1d006..7e41891 100644 --- a/Lib/test/test_shutil.py +++ b/Lib/test/test_shutil.py @@ -1837,6 +1837,8 @@ class TermsizeTests(unittest.TestCase): self.assertEqual(size.lines, 888) @unittest.skipUnless(os.isatty(sys.__stdout__.fileno()), "not on tty") + @unittest.skipUnless(hasattr(os, 'get_terminal_size'), + 'need os.get_terminal_size()') def test_stty_match(self): """Check if stty returns the same results ignoring env |