Skip to content

Commit 81e89a5

Browse files
committed
bug: make sure UnixAdapter has default_settings
so it doesn't choke when used directly (e.g.: like [httpie-unixsocket](https://github.com/httpie/httpie-unixsocket) does) and no explicit settings are provided.
1 parent 305215d commit 81e89a5

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

requests_unixsocket/adapters.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
except ImportError:
1414
import urllib3
1515

16+
from .settings import default_settings
1617

1718
# The following was adapted from some code from docker-py
1819
# https://github.com/docker/docker-py/blob/master/docker/transport/unixconn.py
@@ -56,10 +57,11 @@ def _new_conn(self):
5657

5758

5859
class UnixAdapter(HTTPAdapter):
59-
def __init__(self, timeout=60, pool_connections=25, settings=None,
60+
def __init__(self, timeout=60, pool_connections=25,
61+
settings=None,
6062
*args, **kwargs):
6163
super(UnixAdapter, self).__init__(*args, **kwargs)
62-
self.settings = settings
64+
self.settings = settings or default_settings
6365
self.timeout = timeout
6466
self.pools = urllib3._collections.RecentlyUsedContainer(
6567
pool_connections, dispose_func=lambda p: p.close()

0 commit comments

Comments
 (0)