5656
5757__all__ = ["copyfileobj" , "copyfile" , "copymode" , "copystat" , "copy" , "copy2" ,
5858 "copytree" , "move" , "rmtree" , "Error" , "SpecialFileError" ,
59- "ExecError" , " make_archive" , "get_archive_formats" ,
59+ "make_archive" , "get_archive_formats" ,
6060 "register_archive_format" , "unregister_archive_format" ,
6161 "get_unpack_formats" , "register_unpack_format" ,
6262 "unregister_unpack_format" , "unpack_archive" ,
@@ -74,8 +74,6 @@ class SpecialFileError(OSError):
7474 """Raised when trying to do a kind of operation (e.g. copying) which is
7575 not supported on a special file (e.g. a named pipe)"""
7676
77- class ExecError (OSError ):
78- """Raised when a command could not be executed"""
7977
8078class ReadError (OSError ):
8179 """Raised when an archive cannot be read"""
@@ -1582,3 +1580,15 @@ def which(cmd, mode=os.F_OK | os.X_OK, path=None):
15821580 if _access_check (name , mode ):
15831581 return name
15841582 return None
1583+
1584+ def __getattr__ (name ):
1585+ if name == "ExecError" :
1586+ import warnings
1587+ warnings ._deprecated (
1588+ "shutil.ExecError" ,
1589+ f"{ warnings ._DEPRECATED_MSG } ; it "
1590+ "isn't raised by any shutil function." ,
1591+ remove = (3 , 16 )
1592+ )
1593+ return RuntimeError
1594+ raise AttributeError (f"module { __name__ !r} has no attribute { name !r} " )
0 commit comments