Fixed empty recv case (#4577).

This commit is contained in:
Christian P. MOMON 2020-07-10 21:26:44 +02:00 committed by root
parent 2d11e3ad35
commit 7969bf68f6
1 changed files with 2 additions and 2 deletions

View File

@ -171,8 +171,8 @@ class Bot(object):
def msg_handler(self): # pragma: no cover (this excludes this function from testing)
new_msg = self.ircsock.recv(2048) # receive data from the server
if not new_msg:
print "Empty recv."
new_msg=''
print "Empty recv. It seems Ive lost my mind. I stop to be reborn."
sys.exit(7)
else:
new_msg = new_msg.strip('\n\r') # removing any unnecessary linebreaks
if new_msg != '' and new_msg.find("PING :") == -1: