gh-123084: Turn shutil.ExecError into a deprecated alias of RuntimeError (#123125)

This commit is contained in:
Peter Bierma 2024-08-20 20:39:24 -04:00 committed by GitHub
parent f88c14d412
commit 9dbd123755
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
4 changed files with 25 additions and 4 deletions

View file

@ -3393,7 +3393,7 @@ class PublicAPITests(unittest.TestCase):
self.assertTrue(hasattr(shutil, '__all__'))
target_api = ['copyfileobj', 'copyfile', 'copymode', 'copystat',
'copy', 'copy2', 'copytree', 'move', 'rmtree', 'Error',
'SpecialFileError', 'ExecError', 'make_archive',
'SpecialFileError', 'make_archive',
'get_archive_formats', 'register_archive_format',
'unregister_archive_format', 'get_unpack_formats',
'register_unpack_format', 'unregister_unpack_format',
@ -3402,6 +3402,8 @@ class PublicAPITests(unittest.TestCase):
if hasattr(os, 'statvfs') or os.name == 'nt':
target_api.append('disk_usage')
self.assertEqual(set(shutil.__all__), set(target_api))
with self.assertWarns(DeprecationWarning):
from shutil import ExecError
if __name__ == '__main__':