Prevent .strip() from being called on None
authorAlexander Koumis <me@alexander.computer>
Thu, 30 Mar 2017 04:57:54 +0000 (21:57 -0700)
committerAlexander Koumis <me@alexander.computer>
Thu, 30 Mar 2017 04:57:54 +0000 (21:57 -0700)
tweepy/streaming.py

index e272fb8c879e581bc6d28b0179d798bcc9d4a75f..82a7ac2ebbfb029f01093067f647ef1a8c12effd 100644 (file)
@@ -313,10 +313,10 @@ class Stream(object):
         while self.running and not resp.raw.closed:
             length = 0
             while not resp.raw.closed:
-                line = buf.read_line().strip()
+                line = buf.read_line()
                 if not line:
                     self.listener.keep_alive()  # keep-alive new lines are expected
-                elif line.isdigit():
+                elif line.strip().isdigit():
                     length = int(line)
                     break
                 else: