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.




相关文章:

  • 2022-12-23
  • 2021-08-07
  • 2021-09-12
  • 2022-12-23
  • 2021-10-22
  • 2021-12-24
  • 2021-06-27
  • 2021-07-07
猜你喜欢
  • 2022-12-23
  • 2022-03-03
  • 2021-07-16
  • 2021-07-11
  • 2021-10-31
  • 2021-09-28
  • 2021-09-18
相关资源
相似解决方案