Last active
September 16, 2015 10:37
-
-
Save OddBloke/3216436e74c8901c5827 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
f = open(...) | |
try: | |
json.loads(f.read()) | |
except ValueError: | |
print "Invalid JSON" | |
raise | |
finally: | |
f.close() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
but won't the following behave identically?: