我试图在 Python 2.7 中捕获这个特定的异常(并且只有这个异常),但我似乎找不到关于异常类的文档。有吗?
[Errno 10054] An existing connection was forcibly closed by the remote host
到目前为止我的代码:
try:
# Deleting filename
self.ftp.delete(filename)
return True
except (error_reply, error_perm, error_temp):
return False
except # ?? What goes here for Errno 10054 ??
reconnect()
retry_action()