Skip to content

Commit

Permalink
Make compatible with requests 2.29.0.
Browse files Browse the repository at this point in the history
  • Loading branch information
felixfontein committed May 2, 2023
1 parent a02ba74 commit 2c8084e
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 7 deletions.
6 changes: 3 additions & 3 deletions docker/transport/npipeconn.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,17 +5,17 @@
from .. import constants
from .npipesocket import NpipeSocket

import http.client as httplib

try:
import requests.packages.urllib3 as urllib3
import requests.packages.urllib3.connection as urllib3_connection
except ImportError:
import urllib3
import urllib3.connection as urllib3_connection

RecentlyUsedContainer = urllib3._collections.RecentlyUsedContainer


class NpipeHTTPConnection(httplib.HTTPConnection):
class NpipeHTTPConnection(urllib3_connection.HTTPConnection):
def __init__(self, npipe_path, timeout=60):
super().__init__(
'localhost', timeout=timeout
Expand Down
6 changes: 3 additions & 3 deletions docker/transport/sshconn.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,12 @@
from docker.transport.basehttpadapter import BaseHTTPAdapter
from .. import constants

import http.client as httplib

try:
import requests.packages.urllib3 as urllib3
import requests.packages.urllib3.connection as urllib3_connection
except ImportError:
import urllib3
import urllib3.connection as urllib3_connection

RecentlyUsedContainer = urllib3._collections.RecentlyUsedContainer

Expand Down Expand Up @@ -99,7 +99,7 @@ def close(self):
self.proc.terminate()


class SSHConnection(httplib.HTTPConnection):
class SSHConnection(urllib3_connection.HTTPConnection):
def __init__(self, ssh_transport=None, timeout=60, host=None):
super().__init__(
'localhost', timeout=timeout
Expand Down
4 changes: 3 additions & 1 deletion docker/transport/unixconn.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,16 @@

try:
import requests.packages.urllib3 as urllib3
import requests.packages.urllib3.connection as urllib3_connection
except ImportError:
import urllib3
import urllib3.connection as urllib3_connection


RecentlyUsedContainer = urllib3._collections.RecentlyUsedContainer


class UnixHTTPConnection(httplib.HTTPConnection):
class UnixHTTPConnection(urllib3_connection.HTTPConnection):

def __init__(self, base_url, unix_socket, timeout=60):
super().__init__(
Expand Down

0 comments on commit 2c8084e

Please sign in to comment.