1
0
mirror of https://github.com/openSUSE/osc.git synced 2024-12-28 10:46:15 +01:00

- fix for older python versions

This commit is contained in:
Marcus Hüwe 2009-05-08 18:54:26 +00:00
parent 287d8c2fbd
commit fb992a24fc

View File

@ -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)