mirror of
https://github.com/ansible-collections/community.general.git
synced 2026-05-06 21:32:49 +00:00
Fixing HTTPError case of fetch_url for Python 3 compatibility. (#45628)
* Fixing HTTPError case of fetch_url for Python 3 compatibility. * Adding unit test. * PEP8. * Changelog.
This commit is contained in:
committed by
Matt Martz
parent
d34cf93f1a
commit
bc69aeca7f
@@ -1303,7 +1303,8 @@ def fetch_url(module, url, data=None, headers=None, method=None,
|
||||
|
||||
# Try to add exception info to the output but don't fail if we can't
|
||||
try:
|
||||
info.update(dict(**e.info()))
|
||||
# Lowercase keys, to conform to py2 behavior, so that py3 and py2 are predictable
|
||||
info.update(dict((k.lower(), v) for k, v in e.info().items()))
|
||||
except:
|
||||
pass
|
||||
|
||||
|
||||
Reference in New Issue
Block a user