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:
parent
287d8c2fbd
commit
fb992a24fc
@ -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)
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user