Created
December 3, 2015 09:28
-
-
Save fabiand/8ef2817b82975d279efa 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
@contextmanager | |
def download_iso(w): | |
# do download | |
yield path_to_w | |
# do removal | |
with downloaded_iso("centos") as isopath: | |
# do stuff | |
##### THIS IS EQUAL TO | |
try: | |
isopath = download_iso("centos") | |
# do stuff | |
except: | |
# foo | |
finally: | |
# do removal |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment