Skip to content

Commit

Permalink
...
Browse files Browse the repository at this point in the history
  • Loading branch information
blueloveTH committed Aug 25, 2023
1 parent e2d06d5 commit 77b525c
Showing 1 changed file with 3 additions and 14 deletions.
17 changes: 3 additions & 14 deletions source/_posts/python.md
Original file line number Diff line number Diff line change
Expand Up @@ -1644,17 +1644,6 @@ except TypeError:
pass # won't catch the IndexError
except IndexError:
print("An index error occurred")
```
<!-- ```python
try:
# Use "raise" to raise an error
raise IndexError("This is an index error")
except IndexError as e:
pass # Pass is just a no-op. Usually you would do recovery here.
except (TypeError, NameError):
pass # Multiple exceptions can be handled together, if required.
else: # Optional clause to the try/except block. Must follow all except blocks
print("All good!") # Runs only if the code in try raises no exceptions
finally: # Execute under all circumstances
print("We can clean up resources here")
``` -->
# (unsupport) finally:
# print("This will always be called")
```

0 comments on commit 77b525c

Please sign in to comment.