From fb992a24fc9a30aca02f6cefc8689e082d021ebd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marcus=20H=C3=BCwe?= Date: Fri, 8 May 2009 18:54:26 +0000 Subject: [PATCH] - fix for older python versions --- osc/core.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/osc/core.py b/osc/core.py index 3f31b835..5f7da4ee 100755 --- a/osc/core.py +++ b/osc/core.py @@ -22,6 +22,7 @@ import oscerr import conf import subprocess import re +import socket try: from xml.etree import cElementTree as ET except ImportError: @@ -1538,9 +1539,12 @@ def http_request(method, url, headers={}, data=None, file=None, timeout=100): if conf.config['debug']: print method, url + old_timeout = socket.getdefaulttimeout() + socket.setdefaulttimeout(timeout) try: - fd = urllib2.urlopen(req, data=data, timeout=timeout) + fd = urllib2.urlopen(req, data=data) finally: + socket.setdefaulttimeout(old_timeout) if hasattr(conf.cookiejar, 'save'): conf.cookiejar.save(ignore_discard=True)