Browse Source

A missing timeout that would break in Python 2.5

master
Julio Biason 15 years ago
parent
commit
ac9680a766
  1. 6
      mitterlib/ui/ui_pygtk.py

6
mitterlib/ui/ui_pygtk.py

@ -881,7 +881,11 @@ class Interface(object):
timeout = self._options['NetworkManager']['timeout'] timeout = self._options['NetworkManager']['timeout']
_log.debug('Starting request of %s (timeout %ds)' % ( _log.debug('Starting request of %s (timeout %ds)' % (
url, timeout)) url, timeout))
response = urllib2.urlopen(request, timeout=timeout) try:
response = urllib2.urlopen(request, timeout=timeout)
except TypeError, e:
# Python 2.5 don't have a timeout parameter
response = urllib2.urlopen(request)
data = response.read() data = response.read()
_log.debug('Request completed') _log.debug('Request completed')
return (url, data) return (url, data)

Loading…
Cancel
Save