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.




原文地址:https://www.cnblogs.com/hiSunshine/p/a64a110b616d92156505bbd9b0f824b7.html