1
0
mirror of https://github.com/openSUSE/osc.git synced 2024-12-25 17:36:13 +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:
raise RuntimeError('either specify text or file')
resp = urllib2.addinfourl(f, {}, url)
resp.code = 200
resp.code = kwargs.get('code', 200)
resp.msg = ''
return resp