Last active
May 1, 2022 02:38
-
-
Save eggplants/c92d715eb195c1841256f2b0e91f5dc6 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
n = 3 | |
_e = None | |
for i in range(n): | |
print("attempt:", n) | |
try: | |
# ... | |
# sth to do with possibility to fail | |
# ... | |
break | |
except Exception as e: | |
_e = e | |
pass | |
else: # will be ignored without fail | |
raise _e |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment