Replace six.reraise
authorHarmon <Harmon758@gmail.com>
Sat, 26 Dec 2020 08:33:59 +0000 (02:33 -0600)
committerHarmon <Harmon758@gmail.com>
Sat, 26 Dec 2020 08:33:59 +0000 (02:33 -0600)
tweepy/binder.py
tweepy/streaming.py

index 08974257508a02822a38785b4cfc299d7cb9eceb..757733be71b9a976c6673e6a2e838fe8a12bbefb 100644 (file)
@@ -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')
 
index d77cdaa16ebb6624b4a58bb673cbd42aa5e41de5..b9be9fff646ef09b07578ff3fcdda97daef3e49e 100644 (file)
@@ -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: