getattr() with no default is an AttributeError if missing (#32946)

This commit is contained in:
Nathaniel Case 2017-11-15 15:40:32 -05:00 committed by GitHub
parent 3089892e59
commit 21c8ab537b
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -299,7 +299,7 @@ def main():
except Exception as exc:
# Only network_cli has update_play context, so missing this is
# not fatal e.g. netconf
if isinstance(exc, ConnectionError) and getattr(exc, 'code') == -32601:
if isinstance(exc, ConnectionError) and getattr(exc, 'code', None) == -32601:
pass
else:
result.update({