8000 Doc: Prettier exception hierarchy. (GH-26533) · python/cpython@c4955e2 · GitHub
[go: up one dir, main page]

Skip to content

Commit c4955e2

Browse files
authored
Doc: Prettier exception hierarchy. (GH-26533)
1 parent 62f1d2b commit c4955e2

File tree

3 files changed

+66
-65
lines changed

3 files changed

+66
-65
lines changed

Doc/library/exceptions.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -821,3 +821,4 @@ Exception hierarchy
821821
The class hierarchy for built-in exceptions is:
822822

823823
.. literalinclude:: ../../Lib/test/exception_hierarchy.txt
824+
:language: text

Lib/test/exception_hierarchy.txt

Lines changed: 64 additions & 64 deletions
Original file line numberDiff line numberDiff line change
@@ -1,65 +1,65 @@
11
BaseException
2-
+-- SystemExit
3-
+-- KeyboardInterrupt
4-
+-- GeneratorExit
5-
+-- Exception
6-
+-- StopIteration
7-
+-- StopAsyncIteration
8-
+-- ArithmeticError
9-
| +-- FloatingPointError
10-
| +-- OverflowError
11-
| +-- ZeroDivisionError
12-
+-- AssertionError
13-
+-- AttributeError
14-
+-- BufferError
15-
+-- EOFError
16-
+-- ImportError
17-
| +-- ModuleNotFoundError
18-
+-- LookupError
19-
| +-- IndexError
20-
| +-- KeyError
21-
+-- MemoryError
22-
+-- NameError
23-
| +-- UnboundLocalError
24-
+-- OSError
25-
| +-- BlockingIOError
26-
| +-- ChildProcessError
27-
| +-- ConnectionError
28-
| | +-- BrokenPipeError
29-
| | +-- ConnectionAbortedError
30-
| | +-- ConnectionRefusedError
31-
| | +-- ConnectionResetError
32-
| +-- FileExistsError
33-
| +-- FileNotFoundError
34-
| +-- InterruptedError
35-
| +-- IsADirectoryError
36-
| +-- NotADirectoryError
37-
| +-- PermissionError
38-
| +-- ProcessLookupError
39-
| +-- TimeoutError
40-
+-- ReferenceError
41-
+-- RuntimeError
42-
| +-- NotImplementedError
43-
| +-- RecursionError
44-
+-- SyntaxError
45-
| +-- IndentationError
46-
| +-- TabError
47-
+-- SystemError
48-
+-- TypeError
49-
+-- ValueError
50-
| +-- UnicodeError
51-
| +-- UnicodeDecodeError
52-
| +-- UnicodeEncodeError
53-
| +-- UnicodeTranslateError
54-
+-- Warning
55-
+-- DeprecationWarning
56-
+-- PendingDeprecationWarning
57-
+-- RuntimeWarning
58-
+-- SyntaxWarning
59-
+-- UserWarning
60-
+-- FutureWarning
61-
+-- ImportWarning
62-
+-- UnicodeWarning
63-
+-- BytesWarning
64-
+-- EncodingWarning
65-
+-- ResourceWarning
2+
├── SystemExit
3+
├── KeyboardInterrupt
4+
├── GeneratorExit
5+
└── Exception
6+
├── StopIteration
7+
├── StopAsyncIteration
8+
├── ArithmeticError
9+
├── FloatingPointError
10+
├── OverflowError
11+
└── ZeroDivisionError
12+
├── AssertionError
13+
├── AttributeError
14+
├── BufferError
15+
├── EOFError
16+
├── ImportError
17+
└── ModuleNotFoundError
18+
├── LookupError
19+
├── IndexError
20+
└── KeyError
21+
├── MemoryError
22+
├── NameError
23+
└── UnboundLocalError
24+
├── OSError
25+
├── BlockingIOError
26+
├── ChildProcessError
27+
├── ConnectionError
28+
├── BrokenPipeError
29+
├── ConnectionAbortedError
30+
├── ConnectionRefusedError
31+
└── ConnectionResetError
32+
├── FileExistsError
33+
├── FileNotFoundError
34+
├── InterruptedError
35+
├── IsADirectoryError
36+
├── NotADirectoryError
37+
├── PermissionError
38+
├── ProcessLookupError
39+
└── TimeoutError
40+
├── ReferenceError
41+
├── RuntimeError
42+
├── NotImplementedError
43+
└── RecursionError
44+
├── SyntaxError
45+
└── IndentationError
46+
└── TabError
47+
├── SystemError
48+
├── TypeError
49+
├── ValueError
50+
└── UnicodeError
51+
├── UnicodeDecodeError
52+
├── UnicodeEncodeError
53+
└── UnicodeTranslateError
54+
└── Warning
55+
├── DeprecationWarning
56+
├── PendingDeprecationWarning
57+
├── RuntimeWarning
58+
├── SyntaxWarning
59+
├── UserWarning
60+
├── FutureWarning
61+
├── ImportWarning
62+
├── UnicodeWarning
63+
├── BytesWarning
64+
├── EncodingWarning
65+
└── ResourceWarning

Lib/test/test_baseexception.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ def test_inheritance(self):
4444
last_depth = 0
4545
for exc_line in inheritance_tree:
4646
exc_line = exc_line.rstrip()
47-
depth = exc_line.rindex('-')
47+
depth = exc_line.rindex('')
4848
exc_name = exc_line[depth+2:] # Slice past space
4949
if '(' in exc_name:
5050
paren_index = exc_name.index('(')

0 commit comments

Comments
 (0)
0