Skip to content

Instantly share code, notes, and snippets.

@Araq
Created January 1, 2020 00:40
Show Gist options
  • Save Araq/801153ec4d78c60c457542213b3b64e8 to your computer and use it in GitHub Desktop.
Save Araq/801153ec4d78c60c457542213b3b64e8 to your computer and use it in GitHub Desktop.
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