Skip to content

Instantly share code, notes, and snippets.

@evildmp
Forked from OddBloke/gist:3216436e74c8901c5827
Last active September 16, 2015 10:35
Show Gist options
  • Save evildmp/b3140232789e517091a3 to your computer and use it in GitHub Desktop.
Save evildmp/b3140232789e517091a3 to your computer and use it in GitHub Desktop.
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