Fixed empty recv case (#4577).
This commit is contained in:
parent
2d11e3ad35
commit
7969bf68f6
@ -171,8 +171,8 @@ class Bot(object):
|
|||||||
def msg_handler(self): # pragma: no cover (this excludes this function from testing)
|
def msg_handler(self): # pragma: no cover (this excludes this function from testing)
|
||||||
new_msg = self.ircsock.recv(2048) # receive data from the server
|
new_msg = self.ircsock.recv(2048) # receive data from the server
|
||||||
if not new_msg:
|
if not new_msg:
|
||||||
print "Empty recv."
|
print "Empty recv. It seems I’ve lost my mind. I stop to be reborn."
|
||||||
new_msg=''
|
sys.exit(7)
|
||||||
else:
|
else:
|
||||||
new_msg = new_msg.strip('\n\r') # removing any unnecessary linebreaks
|
new_msg = new_msg.strip('\n\r') # removing any unnecessary linebreaks
|
||||||
if new_msg != '' and new_msg.find("PING :") == -1:
|
if new_msg != '' and new_msg.find("PING :") == -1:
|
||||||
|
Loading…
Reference in New Issue
Block a user