diff options
author | Sebastian Deiss <s.deiss@science-computing.de> | 2014-02-11 13:01:49 +0100 |
---|---|---|
committer | Sebastian Deiss <s.deiss@science-computing.de> | 2014-02-11 13:01:49 +0100 |
commit | e7f41de2f2dac5d03404f35edc5514f12e42c49f (patch) | |
tree | eae66247e741b2acdcc5ec10712af231992296a0 /tests/loop.py | |
parent | a08ac06083a40eb1455e5fa14cd644f7a2350f16 (diff) |
Merge branch scottkmaxwell:py3-support-without-py25 into
SebastianDeiss:gssapi-py3-support
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..6e933f83 100644 --- a/tests/loop.py +++ b/tests/loop.py @@ -21,6 +21,7 @@ """ import threading, socket +from paramiko.common import * 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: |