diff options
author | Jeff Forcier <jeff@bitprophet.org> | 2014-09-06 16:07:24 -0700 |
---|---|---|
committer | Jeff Forcier <jeff@bitprophet.org> | 2014-09-06 16:07:24 -0700 |
commit | 08239ff4b29c0b53c5443f21ae482e51340223f6 (patch) | |
tree | 73f0b7e4d25a80c965186d03abde9c006b1feec0 /tests/loop.py | |
parent | 5335d9dc0a6266217d288e7aaf2091739980d841 (diff) | |
parent | 6a6ac4d78421667b810f5e3a017fb669853133f9 (diff) |
Merge branch 'master' into 234-int
Diffstat (limited to 'tests/loop.py')
-rw-r--r-- | tests/loop.py | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/tests/loop.py b/tests/loop.py index 91c216d2..4f5dc163 100644 --- a/tests/loop.py +++ b/tests/loop.py @@ -21,6 +21,7 @@ """ import threading, socket +from paramiko.common import asbytes class LoopSocket (object): @@ -31,7 +32,7 @@ class LoopSocket (object): """ def __init__(self): - self.__in_buffer = '' + self.__in_buffer = bytes() self.__lock = threading.Lock() self.__cv = threading.Condition(self.__lock) self.__timeout = None @@ -41,11 +42,12 @@ class LoopSocket (object): self.__unlink() try: self.__lock.acquire() - self.__in_buffer = '' + self.__in_buffer = bytes() finally: self.__lock.release() def send(self, data): + data = asbytes(data) if self.__mate is None: # EOF raise EOFError() @@ -57,7 +59,7 @@ class LoopSocket (object): try: if self.__mate is None: # EOF - return '' + return bytes() if len(self.__in_buffer) == 0: self.__cv.wait(self.__timeout) if len(self.__in_buffer) == 0: |