From bb07b9507b45c36ff0fdf5530ebe8047ec1145b7 Mon Sep 17 00:00:00 2001 From: Harmon Date: Sat, 26 Dec 2020 01:41:03 -0600 Subject: [PATCH] Remove u prefix from strings --- docs/conf.py | 8 ++++---- tests/test_streaming.py | 10 +++++----- tweepy/streaming.py | 12 ++++++------ 3 files changed, 15 insertions(+), 15 deletions(-) diff --git a/docs/conf.py b/docs/conf.py index a4277b7..ddea406 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -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 diff --git a/tests/test_streaming.py b/tests/test_streaming.py index 474c3b2..c2aae58 100644 --- a/tests/test_streaming.py +++ b/tests/test_streaming.py @@ -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): diff --git a/tweepy/streaming.py b/tweepy/streaming.py index d1b1ff7..8a41a3f 100644 --- a/tweepy/streaming.py +++ b/tweepy/streaming.py @@ -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 -- 2.25.1