exception catch doesn't work?? (python 3)
exception catch doesn't work?? (python 3)
except u.URLError, e:
^
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://images.cnblogs.com/cnblogs_com/hiSunshine/859315/o_1.jpg)
![](https://images.cnblogs.com/cnblogs_com/hiSunshine/859315/o_2.jpg)