1
0
mirror of https://github.com/openSUSE/osc.git synced 2025-01-13 17:16:23 +01:00

- common.py, __get_response: support "code" keyword argument to specify the http status code

This commit is contained in:
Marcus Huewe 2011-03-21 16:52:13 +01:00
parent 5f5ae8e22d
commit e1080aa476

View File

@ -73,7 +73,7 @@ class MyHTTPHandler(urllib2.HTTPHandler):
else: else:
raise RuntimeError('either specify text or file') raise RuntimeError('either specify text or file')
resp = urllib2.addinfourl(f, {}, url) resp = urllib2.addinfourl(f, {}, url)
resp.code = 200 resp.code = kwargs.get('code', 200)
resp.msg = '' resp.msg = ''
return resp return resp