Create a gist now

Instantly share code, notes, and snippets.

What would you like to do?
Python
import urllib2
urlString = 'http://pshmn.com/eaFnY'
try:
handle = urllib2.urlopen(urlString)
handle.read()
handle.close()
except IOError:
print "log error"

Probably time to make this Python3 compatible :) You'll need to change line 9 to print("log error") and not use urllib2. Cheers.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment