mirror of
https://github.com/python/cpython.git
synced 2025-08-31 05:58:33 +00:00
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.
This commit is contained in:
parent
ded4c4967b
commit
119ebb70e9
4 changed files with 8 additions and 1 deletions
|
@ -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
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue