From: Aaron Hill Date: Tue, 25 Feb 2014 18:37:52 +0000 (-0500) Subject: Reset session after making request X-Git-Url: https://vcs.fsf.org/?a=commitdiff_plain;h=6749f83582959ea81837f48e67861ef338706107;p=tweepy.git Reset session after making request --- diff --git a/tweepy/binder.py b/tweepy/binder.py index d3614e3..68074fa 100644 --- a/tweepy/binder.py +++ b/tweepy/binder.py @@ -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: diff --git a/tweepy/streaming.py b/tweepy/streaming.py index c1ab0bc..89d81e1 100644 --- a/tweepy/streaming.py +++ b/tweepy/streaming.py @@ -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)