summaryrefslogtreecommitdiff
path: root/puzzles/tricky_try_except.py
diff options
context:
space:
mode:
authorMartin Fischer <martin@push-f.com>2022-02-23 17:23:38 +0100
committerMartin Fischer <martin@push-f.com>2022-02-23 17:23:38 +0100
commit7c914668646504077caae217ca13332f6244f7d9 (patch)
treec96b1828b6df2c90ab480ad0f06b3840ef53e8b6 /puzzles/tricky_try_except.py
parentccd15c20cdb44ed32b707f44e3f720b159da2f0b (diff)
update tricky_try_except test
Diffstat (limited to 'puzzles/tricky_try_except.py')
-rw-r--r--puzzles/tricky_try_except.py8
1 files changed, 4 insertions, 4 deletions
diff --git a/puzzles/tricky_try_except.py b/puzzles/tricky_try_except.py
index de829c3..d63ab10 100644
--- a/puzzles/tricky_try_except.py
+++ b/puzzles/tricky_try_except.py
@@ -1,8 +1,8 @@
-def foo():
+def foo() -> None:
file = None
try:
file = open('test.json')
except Exception:
- pass
-
- file.name # error
+ return None
+ finally:
+ file.name # error