py3: HTTPResponse has no 'dict' attribute in 'msg'

There is no 'dict' attribute in 'msg', but 'msg' attribute is dict-like object
in both py2/3, so it can be used instead.

https://fedorahosted.org/freeipa/ticket/4985

Reviewed-By: Christian Heimes <cheimes@redhat.com>
Reviewed-By: Jan Cholasta <jcholast@redhat.com>
This commit is contained in:
Martin Basti 2017-01-10 18:24:16 +01:00
parent c0b5c6709d
commit 51578882fc

View File

@ -205,7 +205,7 @@ def _httplib_request(
res = conn.getresponse()
http_status = res.status
http_headers = res.msg.dict
http_headers = res.msg
http_body = res.read()
conn.close()
except Exception as e: