mirror of
https://github.com/ansible-collections/community.docker.git
synced 2026-07-29 03:46:55 +00:00
Python code modernization, 8/n (#1179)
* Use to_text instead of to_native. * Remove no longer needed pylint ignores. * Remove another pylint ignore. * Remove no longer needed ignore. * Address redefined-outer-name. * Address consider-using-with.
This commit is contained in:
@@ -16,6 +16,8 @@ from .._import_helper import HTTPAdapter as _HTTPAdapter
|
||||
|
||||
class BaseHTTPAdapter(_HTTPAdapter):
|
||||
def close(self) -> None:
|
||||
# pylint finds our HTTPAdapter stub instead of requests.adapters.HTTPAdapter:
|
||||
# pylint: disable-next=no-member
|
||||
super().close()
|
||||
if hasattr(self, "pools"):
|
||||
self.pools.clear()
|
||||
|
||||
@@ -58,7 +58,11 @@ class SSLHTTPAdapter(BaseHTTPAdapter):
|
||||
We already take care of a normal poolmanager via init_poolmanager
|
||||
|
||||
But we still need to take care of when there is a proxy poolmanager
|
||||
|
||||
Note that this method is no longer called for newer requests versions.
|
||||
"""
|
||||
# pylint finds our HTTPAdapter stub instead of requests.adapters.HTTPAdapter:
|
||||
# pylint: disable-next=no-member
|
||||
conn = super().get_connection(*args, **kwargs)
|
||||
if (
|
||||
self.assert_hostname is not None
|
||||
|
||||
Reference in New Issue
Block a user