##// END OF EJS Templates
keepalive: use safehasattr instead of hasattr
Augie Fackler -
r14958:fd246aef default
parent child Browse files
Show More
@@ -547,13 +547,14 b' def safesend(self, str):'
547 547 print "send:", repr(str)
548 548 try:
549 549 blocksize = 8192
550 if hasattr(str,'read') :
550 read = getattr(str, 'read', None)
551 if read is not None:
551 552 if self.debuglevel > 0:
552 553 print "sendIng a read()able"
553 data = str.read(blocksize)
554 data = read(blocksize)
554 555 while data:
555 556 self.sock.sendall(data)
556 data = str.read(blocksize)
557 data = read(blocksize)
557 558 else:
558 559 self.sock.sendall(str)
559 560 except socket.error, v:
General Comments 0
You need to be logged in to leave comments. Login now