Permalink
Browse files

Make sure we can pass the connection pool into the client.

  • Loading branch information...
1 parent 06053e4 commit a29f5c2419a026168fad99f1e1d8d5dad57e4e6d @dreid dreid committed Jan 23, 2013
Showing with 6 additions and 5 deletions.
  1. +6 −5 treq/client.py
View
11 treq/client.py
@@ -71,11 +71,12 @@ def with_config(cls, **kwargs):
if not reactor:
from twisted.internet import reactor
- agent = Agent(
- reactor,
- pool=HTTPConnectionPool(
- reactor,
- persistent=kwargs.get('persistent', True)))
+ pool = kwargs.get('pool')
+ if not pool:
+ persistent = kwargs.get('persistent', True)
+ pool = HTTPConnectionPool(reactor, persitent=persistent)
+
+ agent = Agent(reactor, pool=pool)
if kwargs.get('allow_redirects', True):
agent = RedirectAgent(agent)

0 comments on commit a29f5c2

Please sign in to comment.