Skip to content

Commit

Permalink
Merge pull request #9 from mswaanen/master
Browse files Browse the repository at this point in the history
Don't mutate superclass internals
  • Loading branch information
Roadmaster authored Aug 4, 2021
2 parents cd09c8d + 3dad8c0 commit a61e734
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions forcediphttpsadapter/adapters.py
Original file line number Diff line number Diff line change
Expand Up @@ -113,8 +113,8 @@ def __init__(self, *args, **kwargs):
super(ForcedIPHTTPSPoolManager, self).__init__(*args, **kwargs)

def _new_pool(self, scheme, host, port, request_context=None):
kwargs = self.connection_pool_kw
assert scheme == 'https'
kwargs = self.connection_pool_kw.copy()
kwargs['dest_ip'] = self.dest_ip
return ForcedIPHTTPSConnectionPool(host, port, **kwargs)

Expand All @@ -133,12 +133,12 @@ def _new_conn(self):
actual_host = self.proxy.host
actual_port = self.proxy.port

self.conn_kw = getattr(self, 'conn_kw', {})
self.conn_kw['dest_ip'] = self.dest_ip
conn_kw = getattr(self, 'conn_kw', {}).copy()
conn_kw['dest_ip'] = self.dest_ip
conn = ForcedIPHTTPSConnection(
host=actual_host, port=actual_port,
timeout=self.timeout.connect_timeout,
strict=self.strict, **self.conn_kw)
strict=self.strict, **conn_kw)
pc = self._prepare_conn(conn)
return pc

Expand Down

0 comments on commit a61e734

Please sign in to comment.