-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathexceptions_list.py
More file actions
105 lines (99 loc) · 3.02 KB
/
Copy pathexceptions_list.py
File metadata and controls
105 lines (99 loc) · 3.02 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
"""
Lists the exception from the Exception argument until indicated level
"""
def list_exception( Exception_base, level=0 ):
"""
Lists the exception from the Exception argument until indicated level
:param Exception_base: Exception base to list
:param level: under level to go to
:return: None
"""
if level == 0:
print("Base :", Exception_base.__base__.__name__)
print(f"{'| '*level}{Exception_base.__name__}")
for i in Exception_base.__subclasses__():
list_exception( i, level+1)
list_exception(BaseException)
# Base : object
# BaseException
# | BaseExceptionGroup
# | | ExceptionGroup
# | Exception
# | | ArithmeticError
# | | | FloatingPointError
# | | | OverflowError
# | | | ZeroDivisionError
# | | AssertionError
# | | AttributeError
# | | BufferError
# | | EOFError
# | | ImportError
# | | | ModuleNotFoundError
# | | | ZipImportError
# | | LookupError
# | | | IndexError
# | | | KeyError
# | | | CodecRegistryError
# | | MemoryError
# | | NameError
# | | | UnboundLocalError
# | | OSError
# | | | BlockingIOError
# | | | ChildProcessError
# | | | ConnectionError
# | | | | BrokenPipeError
# | | | | ConnectionAbortedError
# | | | | ConnectionRefusedError
# | | | | ConnectionResetError
# | | | FileExistsError
# | | | FileNotFoundError
# | | | InterruptedError
# | | | IsADirectoryError
# | | | NotADirectoryError
# | | | PermissionError
# | | | ProcessLookupError
# | | | TimeoutError
# | | | UnsupportedOperation
# | | ReferenceError
# | | RuntimeError
# | | | NotImplementedError
# | | | RecursionError
# | | | _DeadlockError
# | | StopAsyncIteration
# | | StopIteration
# | | SyntaxError
# | | | IndentationError
# | | | | TabError
# | | SystemError
# | | | CodecRegistryError
# | | TypeError
# | | ValueError
# | | | UnicodeError
# | | | | UnicodeDecodeError
# | | | | UnicodeEncodeError
# | | | | UnicodeTranslateError
# | | | UnsupportedOperation
# | | Warning
# | | | BytesWarning
# | | | DeprecationWarning
# | | | EncodingWarning
# | | | FutureWarning
# | | | ImportWarning
# | | | PendingDeprecationWarning
# | | | ResourceWarning
# | | | RuntimeWarning
# | | | SyntaxWarning
# | | | UnicodeWarning
# | | | UserWarning
# | | ExceptionGroup
# | | error
# | | TokenError
# | | StopTokenizing
# | | E
# | GeneratorExit
# | KeyboardInterrupt
# | SystemExit
"""
NOTES : IOError is an alias of OSError since Python 3.6
"""
print("\nNote : IOError is OSError", IOError is OSError, IOError, OSError)