Last active
November 11, 2015 09:56
-
-
Save fillest/2be320c6089a145e4cc8 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
import contextlib | |
import urllib2 | |
try: | |
with contextlib.closing(urllib2.urlopen(url, timeout = 1)) as resp: | |
#resp.getcode() | |
except urllib2.URLError as e: | |
# |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment