diff options
Diffstat (limited to 'puzzles/30_try_except_finally.py')
-rw-r--r-- | puzzles/30_try_except_finally.py | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/puzzles/30_try_except_finally.py b/puzzles/30_try_except_finally.py new file mode 100644 index 0000000..d63ab10 --- /dev/null +++ b/puzzles/30_try_except_finally.py @@ -0,0 +1,8 @@ +def foo() -> None: + file = None + try: + file = open('test.json') + except Exception: + return None + finally: + file.name # error |