From: Harmon Date: Sat, 26 Dec 2020 08:33:59 +0000 (-0600) Subject: Replace six.reraise X-Git-Url: https://vcs.fsf.org/?a=commitdiff_plain;h=bbdf07839009c8fb979223398dbf13dfc5f3e722;p=tweepy.git Replace six.reraise --- 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: