Skip to content

Commit 6b12f88

Browse files
committed
f
1 parent a879805 commit 6b12f88

File tree

1 file changed

+8
-6
lines changed

1 file changed

+8
-6
lines changed

InternalDocs/exception_handling.md

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,8 @@ except:
1717

1818
compiles into pseudo-code like the following:
1919

20-
<code>
20+
```
21+
{
2122
`RESUME` 0
2223
2324
1 `SETUP_FINALLY` 8 (to L1)
@@ -35,7 +36,8 @@ compiles into pseudo-code like the following:
3536
3637
4 `LOAD_CONST` 1 ('fail')
3738
`STORE_NAME` 1 (res)
38-
</code>
39+
}
40+
```
3941

4042
The `SETUP_FINALLY` instruction specifies that henceforth, exceptions
4143
are handled by the code at label L1. The `POP_BLOCK` instruction
@@ -151,7 +153,7 @@ for a total of five bytes.
151153
Script to parse the exception table
152154
-----------------------------------
153155

154-
<code>
156+
```
155157
def parse_varint(iterator):
156158
b = next(iterator)
157159
val = b & 63
@@ -160,9 +162,9 @@ def parse_varint(iterator):
160162
b = next(iterator)
161163
val |= b&63
162164
return val
163-
</code>
165+
```
164166

165-
<code>
167+
```
166168
def parse_exception_table(code):
167169
iterator = iter(code.co_exceptiontable)
168170
try:
@@ -177,4 +179,4 @@ def parse_exception_table(code):
177179
yield start, end, target, depth, lasti
178180
except StopIteration:
179181
return
180-
</code>
182+
```

0 commit comments

Comments
 (0)