exception catch doesn't work?? (python 3)

exception catch doesn't work?? (python 3)

  1. except u.URLError, e:
  2. ^
  3. SyntaxError: invalid syntax


in Python 3 it's:
 
except u.URLError as e:
 
This a because in Python 2 people sometimes write:
 
except OSError, IOError:
 
thinking that it will catch both OSError and IOError.




posted @ 2016-08-22 14:36  该显示名称已被使用  阅读(152)  评论(0编辑  收藏  举报