Merge pull request #13 from bobbyi/test_loop

Remove comparison between int and str
This commit is contained in:
Jeff Forcier 2012-03-10 20:53:33 -08:00
commit 43ddbb0265
1 changed files with 2 additions and 6 deletions

View File

@ -62,12 +62,8 @@ class LoopSocket (object):
self.__cv.wait(self.__timeout) self.__cv.wait(self.__timeout)
if len(self.__in_buffer) == 0: if len(self.__in_buffer) == 0:
raise socket.timeout raise socket.timeout
if n < self.__in_buffer: out = self.__in_buffer[:n]
out = self.__in_buffer[:n] self.__in_buffer = self.__in_buffer[n:]
self.__in_buffer = self.__in_buffer[n:]
else:
out = self.__in_buffer
self.__in_buffer = ''
return out return out
finally: finally:
self.__lock.release() self.__lock.release()