Skip to content

Commit 8bfaf04

Browse files
Update docs/Secure-Coding-Guide-for-Python/CWE-664/CWE-584/README.md
Co-authored-by: Bartlomiej Karas <[email protected]> Signed-off-by: andrew-costello <[email protected]>
1 parent 1ebac73 commit 8bfaf04

File tree

1 file changed

+1
-1
lines changed
  • docs/Secure-Coding-Guide-for-Python/CWE-664/CWE-584

1 file changed

+1
-1
lines changed

docs/Secure-Coding-Guide-for-Python/CWE-664/CWE-584/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# CWE-584: Return Inside Finally Block
22

3-
Do not use `return` , `break` or `continue` statements in a try-finally block, as the exception will not be processed. The Python documentation [[Python 3.9]](https://docs.python.org/3.9/reference/compound_stmts.html#finally) notes, "If the `finally` clause executes a [`return`](https://docs.python.org/3.9/reference/simple_stmts.html#return) , [`break`](https://docs.python.org/3.9/reference/simple_stmts.html#break) or [`continue`](https://docs.python.org/3.9/reference/simple_stmts.html#continue) statement, the saved exception is discarded."
3+
Do not use `return`, `break` or `continue` statements in a try-finally block, as the exception will not be processed. The Python documentation [[Python 3.9]](https://docs.python.org/3.9/reference/compound_stmts.html#finally) notes, "If the `finally` clause executes a [`return`](https://docs.python.org/3.9/reference/simple_stmts.html#return), [`break`](https://docs.python.org/3.9/reference/simple_stmts.html#break) or [`continue`](https://docs.python.org/3.9/reference/simple_stmts.html#continue) statement, the saved exception is discarded."
44

55
## Non-Compliant Code Example
66

0 commit comments

Comments
 (0)