diff options
author | Ulysses Souza <ulyssessouza@gmail.com> | 2021-03-10 20:43:37 -0300 |
---|---|---|
committer | Ulysses Souza <ulyssessouza@gmail.com> | 2021-03-22 10:18:23 -0300 |
commit | c8fba210a222d4f7fde90da8f48db1e7faa637ec (patch) | |
tree | c895f87ae9f514e0a47a39326d2a004ffd17275b /docker/api/client.py | |
parent | 31775a1532a66cf8a4c183a99bb5c73623147295 (diff) | |
download | docker-py-set-minimal-python-to-3_6.tar.gz |
Remove support to pre python 3.6set-minimal-python-to-3_6
Signed-off-by: Ulysses Souza <ulyssessouza@gmail.com>
Diffstat (limited to 'docker/api/client.py')
-rw-r--r-- | docker/api/client.py | 18 |
1 files changed, 8 insertions, 10 deletions
diff --git a/docker/api/client.py b/docker/api/client.py index 2b67291..ee9ad9c 100644 --- a/docker/api/client.py +++ b/docker/api/client.py @@ -1,10 +1,10 @@ import json import struct +import urllib from functools import partial import requests import requests.exceptions -import six import websocket from .. import auth @@ -192,12 +192,12 @@ class APIClient( # version detection needs to be after unix adapter mounting if version is None or (isinstance( version, - six.string_types + str ) and version.lower() == 'auto'): self._version = self._retrieve_server_version() else: self._version = version - if not isinstance(self._version, six.string_types): + if not isinstance(self._version, str): raise DockerException( 'Version parameter must be a string or None. Found {0}'.format( type(version).__name__ @@ -246,13 +246,13 @@ class APIClient( def _url(self, pathfmt, *args, **kwargs): for arg in args: - if not isinstance(arg, six.string_types): + if not isinstance(arg, str): raise ValueError( 'Expected a string but found {0} ({1}) ' 'instead'.format(arg, type(arg)) ) - quote_f = partial(six.moves.urllib.parse.quote, safe="/:") + quote_f = partial(urllib.parse.quote, safe="/:") args = map(quote_f, args) if kwargs.get('versioned_api', True): @@ -284,7 +284,7 @@ class APIClient( # so we do this disgusting thing here. data2 = {} if data is not None and isinstance(data, dict): - for k, v in six.iteritems(data): + for k, v in iter(data.items()): if v is not None: data2[k] = v elif data is not None: @@ -320,12 +320,10 @@ class APIClient( sock = response.raw._fp.fp.raw.sock elif self.base_url.startswith('http+docker://ssh'): sock = response.raw._fp.fp.channel - elif six.PY3: + else: sock = response.raw._fp.fp.raw if self.base_url.startswith("https://"): sock = sock._sock - else: - sock = response.raw._fp.fp._sock try: # Keep a reference to the response to stop it being garbage # collected. If the response is garbage collected, it will @@ -465,7 +463,7 @@ class APIClient( self._result(res, binary=True) self._raise_for_status(res) - sep = six.binary_type() + sep = b'' if stream: return self._multiplexed_response_stream_helper(res) else: |