mirror of
https://github.com/python/cpython.git
synced 2025-08-30 21:48:47 +00:00
Issue #22665: Add missing get_terminal_size and SameFileError to shutil.__all__.
This commit is contained in:
parent
e1d26f377e
commit
8083cd6c3b
3 changed files with 23 additions and 1 deletions
|
@ -36,7 +36,8 @@ __all__ = ["copyfileobj", "copyfile", "copymode", "copystat", "copy", "copy2",
|
||||||
"register_archive_format", "unregister_archive_format",
|
"register_archive_format", "unregister_archive_format",
|
||||||
"get_unpack_formats", "register_unpack_format",
|
"get_unpack_formats", "register_unpack_format",
|
||||||
"unregister_unpack_format", "unpack_archive",
|
"unregister_unpack_format", "unpack_archive",
|
||||||
"ignore_patterns", "chown", "which"]
|
"ignore_patterns", "chown", "which", "get_terminal_size",
|
||||||
|
"SameFileError"]
|
||||||
# disk_usage is added later, if available on the platform
|
# disk_usage is added later, if available on the platform
|
||||||
|
|
||||||
class Error(OSError):
|
class Error(OSError):
|
||||||
|
|
|
@ -1762,5 +1762,23 @@ class TermsizeTests(unittest.TestCase):
|
||||||
self.assertEqual(expected, actual)
|
self.assertEqual(expected, actual)
|
||||||
|
|
||||||
|
|
||||||
|
class PublicAPITests(unittest.TestCase):
|
||||||
|
"""Ensures that the correct values are exposed in the public API."""
|
||||||
|
|
||||||
|
def test_module_all_attribute(self):
|
||||||
|
self.assertTrue(hasattr(shutil, '__all__'))
|
||||||
|
target_api = ['copyfileobj', 'copyfile', 'copymode', 'copystat',
|
||||||
|
'copy', 'copy2', 'copytree', 'move', 'rmtree', 'Error',
|
||||||
|
'SpecialFileError', 'ExecError', 'make_archive',
|
||||||
|
'get_archive_formats', 'register_archive_format',
|
||||||
|
'unregister_archive_format', 'get_unpack_formats',
|
||||||
|
'register_unpack_format', 'unregister_unpack_format',
|
||||||
|
'unpack_archive', 'ignore_patterns', 'chown', 'which',
|
||||||
|
'get_terminal_size', 'SameFileError']
|
||||||
|
if hasattr(os, 'statvfs') or os.name == 'nt':
|
||||||
|
target_api.append('disk_usage')
|
||||||
|
self.assertEqual(set(shutil.__all__), set(target_api))
|
||||||
|
|
||||||
|
|
||||||
if __name__ == '__main__':
|
if __name__ == '__main__':
|
||||||
unittest.main()
|
unittest.main()
|
||||||
|
|
|
@ -33,6 +33,9 @@ Core and Builtins
|
||||||
Library
|
Library
|
||||||
-------
|
-------
|
||||||
|
|
||||||
|
- Issue #22665: Add missing get_terminal_size and SameFileError to
|
||||||
|
shutil.__all__.
|
||||||
|
|
||||||
- Issue #17381: Fixed handling of case-insensitive ranges in regular
|
- Issue #17381: Fixed handling of case-insensitive ranges in regular
|
||||||
expressions.
|
expressions.
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue