args¶ 异常构造函数的参数元组。有些内建异常(如 IOError)期望一定数量的参数并为此元组的元素分配特殊的含义,而其它异常的调用通常只需要一个单一的字符串来提供一条错误消息。
基于4个网页-相关网页
If your code assumes that a particular exception must be an IOError, take advantage of the language's precision, and say so.
如果您的代码假设某个特定的异常一定是一个IOError,那么利用该语言的精确性,就这么说。
If process 's implementation left it with a fault that resulted in a ValueError, for instance, rather than an IOError, the last handler above would at least report out ValueError as that class name.
举例来说,如果process的实现产生了一个导致ValueError而不是IOError的错误,上面最后一个处理程序至少会将ValueError作为类名报告上来。
应用推荐