35 lines
1.1 KiB
Plaintext
35 lines
1.1 KiB
Plaintext
=== on 3 Mar 2020, 17:27:45 Nicolas Harraudeau wrote:
|
||
Note: There is no need to create issues for \``++raise++`` statements because:
|
||
|
||
* there might be a good reason to raise an exception (Ex: cannot release resource)
|
||
* python will link the new exception and the old exception automatically:
|
||
|
||
----
|
||
In [1]: try:
|
||
...: raise ValueError("try block")
|
||
...: finally:
|
||
...: raise TypeError("finally block")
|
||
...:
|
||
---------------------------------------------------------------------------
|
||
ValueError Traceback (most recent call last)
|
||
<ipython-input-1-dcce5abc58e4> in <module>
|
||
1 try:
|
||
----> 2 raise ValueError("try block")
|
||
3 finally:
|
||
|
||
ValueError: try block
|
||
|
||
During handling of the above exception, another exception occurred:
|
||
|
||
TypeError Traceback (most recent call last)
|
||
<ipython-input-1-dcce5abc58e4> in <module>
|
||
2 raise ValueError("try block")
|
||
3 finally:
|
||
----> 4 raise TypeError("finally block")
|
||
5
|
||
|
||
TypeError: finally block
|
||
----
|
||
|
||
include::../comments-and-links.adoc[]
|