Skip to content

Commit 4ff3de5

Browse files
authored
typo fix
1 parent a196a7c commit 4ff3de5

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

source/c14/p09_raise_exception_in_response_to_another_exception.rst

+5-4
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,8 @@
2020
... int('N/A')
2121
... except ValueError as e:
2222
... raise RuntimeError('A parsing error occurred') from e
23-
>>>
24-
example()
23+
...
24+
>>> example()
2525
Traceback (most recent call last):
2626
File "<stdin>", line 3, in example
2727
ValueError: invalid literal for int() with base 10: 'N/A'
@@ -36,7 +36,7 @@
3636
RuntimeError: A parsing error occurred
3737
>>>
3838

39-
在回溯中科院看到,两个异常都被捕获。
39+
在回溯中可以看到,两个异常都被捕获。
4040
要想捕获这样的异常,你可以使用一个简单的 ``except`` 语句。
4141
不过,你还可以通过查看异常对象的 ``__cause__`` 属性来跟踪异常链。例如:
4242

@@ -87,7 +87,8 @@
8787
... try:
8888
... int('N/A')
8989
... except ValueError:
90-
... raise RuntimeError('A parsing error occurred') from None...
90+
... raise RuntimeError('A parsing error occurred') from None
91+
...
9192
>>>
9293
example3()
9394
Traceback (most recent call last):

0 commit comments

Comments
 (0)