Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make compatible with requests 2.29.0 and urllib3 2.0 #3116

Merged
merged 3 commits into from
May 5, 2023
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
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
felixfontein marked this conversation as resolved.
Show resolved Hide resolved

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