From bb3d2075446b90fbb842266f68b0df91b623d09e Mon Sep 17 00:00:00 2001 From: Alexander Koumis Date: Wed, 29 Mar 2017 21:57:54 -0700 Subject: [PATCH] Prevent .strip() from being called on None --- tweepy/streaming.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tweepy/streaming.py b/tweepy/streaming.py index e272fb8..82a7ac2 100644 --- a/tweepy/streaming.py +++ b/tweepy/streaming.py @@ -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: -- 2.25.1