Created
January 1, 2020 00:40
-
-
Save Araq/801153ec4d78c60c457542213b3b64e8 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
def main(): | |
raiseEx = True | |
returnA = True | |
returnB = True | |
try: #A | |
try: #B | |
if raiseEx: | |
raise OSError() | |
return 3 | |
finally: #B | |
print("B1") | |
if returnB: | |
return 2 | |
print("B2") | |
except OSError as e: #A | |
print("catch") | |
finally: #A | |
print("A1") | |
if returnA: | |
return 1 | |
print("A2") | |
print(main()) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment