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)
if len(self.__in_buffer) == 0:
raise socket.timeout
if n < self.__in_buffer:
out = self.__in_buffer[:n]
self.__in_buffer = self.__in_buffer[n:]
else:
out = self.__in_buffer
self.__in_buffer = ''
out = self.__in_buffer[:n]
self.__in_buffer = self.__in_buffer[n:]
return out
finally:
self.__lock.release()