Tekkaman

导航

 

exception keynote

  

  Note that the parentheses around this tuple are required, because except ValueError, e: was the syntax used for what is normally written as except ValueError as e: in modern Python (described below). The old syntax is still supported for backwards compatibility.

  This means exceptRuntimeError, TypeError is not equivalent to except (RuntimeError, TypeError): but to except RuntimeError as TypeError: which is not what you want.

  参考:https://docs.python.org/2.7/tutorial/errors.html#exceptions

 

posted on 2016-06-22 12:41  Tekkaman  阅读(294)  评论(0编辑  收藏  举报