[英]Should I raise ValueError or OSError for non-existent file arguments?
真的重要吗?(我假设您没有捕获此异常,并且它纯粹是出于个人查看终端输出的信息目的),操作系统将不会看到任何异常,我只是
raise Exception("Invalid Arguments, expected a file that exists not %r"%(filename))
或尝试自然打开文件时让它失败
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.