Skip to content
This repository
Browse code

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

  • Loading branch information...
commit a29f5c2419a026168fad99f1e1d8d5dad57e4e6d 1 parent 06053e4
David Reid authored January 22, 2013

Showing 1 changed file with 6 additions and 5 deletions. Show diff stats Hide diff stats

  1. 11  treq/client.py
11  treq/client.py
@@ -71,11 +71,12 @@ def with_config(cls, **kwargs):
71 71
         if not reactor:
72 72
             from twisted.internet import reactor
73 73
 
74  
-        agent = Agent(
75  
-            reactor,
76  
-            pool=HTTPConnectionPool(
77  
-                reactor,
78  
-                persistent=kwargs.get('persistent', True)))
  74
+        pool = kwargs.get('pool')
  75
+        if not pool:
  76
+            persistent = kwargs.get('persistent', True)
  77
+            pool = HTTPConnectionPool(reactor, persitent=persistent)
  78
+
  79
+        agent = Agent(reactor, pool=pool)
79 80
 
80 81
         if kwargs.get('allow_redirects', True):
81 82
             agent = RedirectAgent(agent)

0 notes on commit a29f5c2

Please sign in to comment.
Something went wrong with that request. Please try again.