bitly / bitly-api-python

python library to the bitly api
http://github.com/bitly/bitly-api-python
Other
245 stars 92 forks source link

bitly_http dropping timeout for non-PyCurl users #2

Open adamn opened 14 years ago

adamn commented 14 years ago
def makeUrllib2Http(url, user_agent):

should be:

def makeUrllib2Http(url, timeout, user_agent):

And use the timeout in urllib2. This requires Python 2.6 so you could wrap this in a try: except: for more portability. However, Python 2.6 has been stable for 2 years now.