Reset session after making request
authorAaron Hill <aa1ronham@gmail.com>
Tue, 25 Feb 2014 18:37:52 +0000 (13:37 -0500)
committerAaron Hill <aa1ronham@gmail.com>
Sun, 27 Apr 2014 02:03:38 +0000 (22:03 -0400)
tweepy/binder.py
tweepy/streaming.py

index d3614e3121fc5a3ab26b4848cf389e5fadd0e907..68074fa554dd153d9a0dc827f9eb36bce7e90be3 100644 (file)
@@ -186,6 +186,7 @@ def bind_api(**config):
                 time.sleep(retry_delay)
                 retries_performed += 1
 
+            self.session = requests.Session()
             # If an error was returned, throw an exception
             self.api.last_response = resp
             if resp.status_code and not 200 <= resp.status_code < 300:
index c1ab0bc91e2b3d55e95336df1ee202aee23bfbdf..89d81e14e417154fe0ffd863233c9688dce4eb89 100644 (file)
@@ -189,6 +189,8 @@ class Stream(object):
         if resp:
             resp.close()
 
+        self.session = requests.Session()
+
         if exception:
             # call a handler first so that the exception can be logged.
             self.listener.on_exception(exception)