rspec/rules/S1143/python/comments-and-links.adoc

35 lines
1.1 KiB
Plaintext
Raw Blame History

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

=== 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[]