From ac9680a7669c4b07b0d51eb2f80dfcd646203122 Mon Sep 17 00:00:00 2001 From: Julio Biason Date: Thu, 22 Apr 2010 14:04:33 -0300 Subject: [PATCH] A missing timeout that would break in Python 2.5 --- mitterlib/ui/ui_pygtk.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/mitterlib/ui/ui_pygtk.py b/mitterlib/ui/ui_pygtk.py index e3de563..51c275f 100644 --- a/mitterlib/ui/ui_pygtk.py +++ b/mitterlib/ui/ui_pygtk.py @@ -881,7 +881,11 @@ class Interface(object): timeout = self._options['NetworkManager']['timeout'] _log.debug('Starting request of %s (timeout %ds)' % ( 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() _log.debug('Request completed') return (url, data)