Skip to content

Commit

Permalink
Rename StreamListener.keep_alive to StreamListener.on_keep_alive
Browse files Browse the repository at this point in the history
To be consistent with other StreamListener methods
  • Loading branch information
Harmon758 committed Jan 4, 2021
1 parent a450095 commit abf4d5d
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions tweepy/streaming.py
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ def on_data(self, raw_data):

log.error("Unknown message type: %s", raw_data)

def keep_alive(self):
def on_keep_alive(self):
"""Called when a keep-alive arrived"""
return

Expand Down Expand Up @@ -289,7 +289,7 @@ def _read_loop(self, resp):
line = buf.read_line()
stripped_line = line.strip() if line else line # line is sometimes None so we need to check here
if not stripped_line:
self.listener.keep_alive() # keep-alive new lines are expected
self.listener.on_keep_alive() # keep-alive new lines are expected
elif stripped_line.isdigit():
length = int(stripped_line)
break
Expand Down

0 comments on commit abf4d5d

Please sign in to comment.