python2的異常類型

  • 2020 年 1 月 14 日
  • 筆記

BaseException   +-- SystemExit   +-- KeyboardInterrupt   +-- GeneratorExit   +-- Exception        +-- StopIteration        +-- StandardError        |    +-- BufferError        |    +-- ArithmeticError        |    |    +-- FloatingPointError        |    |    +-- OverflowError        |    |    +-- ZeroDivisionError        |    +-- AssertionError        |    +-- AttributeError        |    +-- EnvironmentError        |    |    +-- IOError        |    |    +-- OSError        |    |         +-- WindowsError (Windows)        |    |         +-- VMSError (VMS)        |    +-- EOFError        |    +-- ImportError        |    +-- LookupError        |    |    +-- IndexError        |    |    +-- KeyError        |    +-- MemoryError        |    +-- NameError        |    |    +-- UnboundLocalError        |    +-- ReferenceError        |    +-- RuntimeError        |    |    +-- NotImplementedError        |    +-- SyntaxError        |    |    +-- IndentationError        |    |         +-- TabError        |    +-- SystemError        |    +-- TypeError        |    +-- ValueError        |         +-- UnicodeError        |              +-- UnicodeDecodeError        |              +-- UnicodeEncodeError        |              +-- UnicodeTranslateError        +-- Warning             +-- DeprecationWarning             +-- PendingDeprecationWarning             +-- RuntimeWarning             +-- SyntaxWarning             +-- UserWarning             +-- FutureWarning  	   +-- ImportWarning  	   +-- UnicodeWarning  	   +-- BytesWarning