diff options
author | Mads Jensen <mje@inducks.org> | 2020-09-19 12:35:49 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-09-19 12:35:49 +0300 |
commit | 501df0dc4e289b04e73a9c64ca1ff2fda335536b (patch) | |
tree | ad839f93b4d1d7d464b09002e4e39904c2af99fc /acme | |
parent | b551b6ee73632422b7769a6d4a18cb1990307818 (diff) |
Use in dict rather than "in dict.keys()". Fix linting warnings about "not in". (#8298)
* Fixed a few linting warnings for if not x in y.
These should have been caught by pylint, but weren't.
* Replaced "x in y.keys()" with "x in y".
It's much faster, and more Pythonic.
Diffstat (limited to 'acme')
-rw-r--r-- | acme/acme/client.py | 2 | ||||
-rw-r--r-- | acme/tests/client_test.py | 2 |
2 files changed, 2 insertions, 2 deletions
diff --git a/acme/acme/client.py b/acme/acme/client.py index 19e444749..f66367c38 100644 --- a/acme/acme/client.py +++ b/acme/acme/client.py @@ -801,7 +801,7 @@ class ClientV2(ClientBase): """ # Can't use response.links directly because it drops multiple links # of the same relation type, which is possible in RFC8555 responses. - if not 'Link' in response.headers: + if 'Link' not in response.headers: return [] links = parse_header_links(response.headers['Link']) return [l['url'] for l in links diff --git a/acme/tests/client_test.py b/acme/tests/client_test.py index d433879e8..c84878c42 100644 --- a/acme/tests/client_test.py +++ b/acme/tests/client_test.py @@ -1342,7 +1342,7 @@ class ClientNetworkSourceAddressBindingTest(unittest.TestCase): # test should fail if the default adapter type is changed by requests net = ClientNetwork(key=None, alg=None) session = requests.Session() - for scheme in session.adapters.keys(): + for scheme in session.adapters: client_network_adapter = net.session.adapters.get(scheme) default_adapter = session.adapters.get(scheme) self.assertEqual(client_network_adapter.__class__, default_adapter.__class__) |