Remove u prefix from strings
authorHarmon <Harmon758@gmail.com>
Sat, 26 Dec 2020 07:41:03 +0000 (01:41 -0600)
committerHarmon <Harmon758@gmail.com>
Sat, 26 Dec 2020 07:41:03 +0000 (01:41 -0600)
docs/conf.py
tests/test_streaming.py
tweepy/streaming.py

index a4277b70488decf90f68b9e1256b9a71167d2a25..ddea406b81d68f607da12be52ce4254b45bc5283 100644 (file)
@@ -39,8 +39,8 @@ source_suffix = '.rst'
 master_doc = 'index'
 
 # General information about the project.
-project = u'tweepy'
-copyright = u'2009-2020, Joshua Roesslein'
+project = 'tweepy'
+copyright = '2009-2020, Joshua Roesslein'
 
 # The version info for the project you're documenting, acts as replacement for
 # |version| and |release|, also used in various other places throughout the
@@ -179,8 +179,8 @@ htmlhelp_basename = 'tweepydoc'
 # Grouping the document tree into LaTeX files. List of tuples
 # (source start file, target name, title, author, documentclass [howto/manual]).
 latex_documents = [
-  ('index', 'tweepy.tex', u'tweepy Documentation',
-   u'Joshua Roesslein', 'manual'),
+  ('index', 'tweepy.tex', 'tweepy Documentation',
+   'Joshua Roesslein', 'manual'),
 ]
 
 # The name of an image file (relative to this directory) to place at the top of
index 474c3b243303b9ec751aa553aa4e389394841463..c2aae58c5a6588ffd844408d59854b3023b93bc3 100644 (file)
@@ -98,18 +98,18 @@ class TweepyStreamTests(unittest.TestCase):
     def test_track_encoding(self):
         s = Stream(None, None)
         s._start = lambda is_async: None
-        s.filter(track=[u'Caf\xe9'])
+        s.filter(track=['Caf\xe9'])
 
         # Should be UTF-8 encoded
-        self.assertEqual(u'Caf\xe9'.encode('utf8'), s.body['track'])
+        self.assertEqual('Caf\xe9'.encode('utf8'), s.body['track'])
 
     def test_follow_encoding(self):
         s = Stream(None, None)
         s._start = lambda is_async: None
-        s.filter(follow=[u'Caf\xe9'])
+        s.filter(follow=['Caf\xe9'])
 
         # Should be UTF-8 encoded
-        self.assertEqual(u'Caf\xe9'.encode('utf8'), s.body['follow'])
+        self.assertEqual('Caf\xe9'.encode('utf8'), s.body['follow'])
 
 
 class TweepyStreamReadBufferTests(unittest.TestCase):
@@ -175,7 +175,7 @@ class TweepyStreamReadBufferTests(unittest.TestCase):
             self.assertEqual('{id:12345}\n', buf.read_len(11))
             self.assertEqual('\n', buf.read_line())
             self.assertEqual('23\n', buf.read_line())
-            self.assertEqual(u'{id:23456, test:"\u3053"}\n', buf.read_len(23))
+            self.assertEqual('{id:23456, test:"\u3053"}\n', buf.read_len(23))
 
 
 class TweepyStreamBackoffTests(unittest.TestCase):
index d1b1ff7b3274b03b3947c336f47f78b8bbb0f9f8..8a41a3f08ca8ccccc809cc4265a7fce9b31bf136 100644 (file)
@@ -415,7 +415,7 @@ class Stream(object):
                                  "it has to be a multiple of 4")
             self.session.params['locations'] = ','.join(['%.2f' % l for l in locations])
         if track:
-            self.session.params['track'] = u','.join(track).encode(encoding)
+            self.session.params['track'] = ','.join(track).encode(encoding)
 
         self._start(is_async)
 
@@ -454,18 +454,18 @@ class Stream(object):
             raise TweepError('Stream object already connected!')
         self.url = '/%s/statuses/filter.json' % STREAM_VERSION
         if follow:
-            self.body['follow'] = u','.join(follow).encode(encoding)
+            self.body['follow'] = ','.join(follow).encode(encoding)
         if track:
-            self.body['track'] = u','.join(track).encode(encoding)
+            self.body['track'] = ','.join(track).encode(encoding)
         if locations and len(locations) > 0:
             if len(locations) % 4 != 0:
                 raise TweepError("Wrong number of locations points, "
                                  "it has to be a multiple of 4")
-            self.body['locations'] = u','.join(['%.4f' % l for l in locations])
+            self.body['locations'] = ','.join(['%.4f' % l for l in locations])
         if stall_warnings:
             self.body['stall_warnings'] = stall_warnings
         if languages:
-            self.body['language'] = u','.join(map(str, languages))
+            self.body['language'] = ','.join(map(str, languages))
         if filter_level:
             self.body['filter_level'] = filter_level.encode(encoding)
         self.session.params = {'delimited': 'length'}
@@ -477,7 +477,7 @@ class Stream(object):
         if self.running:
             raise TweepError('Stream object already connected!')
         self.url = '/%s/site.json' % STREAM_VERSION
-        self.body['follow'] = u','.join(map(six.text_type, follow))
+        self.body['follow'] = ','.join(map(six.text_type, follow))
         self.body['delimited'] = 'length'
         if stall_warnings:
             self.body['stall_warnings'] = stall_warnings