From bbdf07839009c8fb979223398dbf13dfc5f3e722 Mon Sep 17 00:00:00 2001 From: Harmon Date: Sat, 26 Dec 2020 02:33:59 -0600 Subject: [PATCH] Replace six.reraise --- tweepy/binder.py | 3 +-- tweepy/streaming.py | 3 +-- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/tweepy/binder.py b/tweepy/binder.py index 0897425..757733b 100644 --- a/tweepy/binder.py +++ b/tweepy/binder.py @@ -8,7 +8,6 @@ import sys import time import requests -import six from urllib.parse import quote, urlencode from tweepy.error import is_rate_limit_error_message, RateLimitError, TweepError @@ -189,7 +188,7 @@ def bind_api(**config): auth=auth, proxies=self.api.proxy) except Exception as e: - six.reraise(TweepError, TweepError('Failed to send request: %s' % e), sys.exc_info()[2]) + raise TweepError('Failed to send request: %s' % e).with_traceback(sys.exc_info()[2]) rem_calls = resp.headers.get('x-rate-limit-remaining') diff --git a/tweepy/streaming.py b/tweepy/streaming.py index d77cdaa..b9be9ff 100644 --- a/tweepy/streaming.py +++ b/tweepy/streaming.py @@ -13,7 +13,6 @@ import sys from threading import Thread from time import sleep -import six from requests.exceptions import Timeout from tweepy.api import API @@ -315,7 +314,7 @@ class Stream: if exc_info: # call a handler first so that the exception can be logged. self.listener.on_exception(exc_info[1]) - six.reraise(*exc_info) + raise exc_info[1] def _data(self, data): if self.listener.on_data(data) is False: -- 2.25.1