diff options
author | Jeff Forcier <jeff@bitprophet.org> | 2018-09-17 17:58:44 -0700 |
---|---|---|
committer | Jeff Forcier <jeff@bitprophet.org> | 2018-09-17 17:58:44 -0700 |
commit | 4cc767f5cd109a459571abbf21c68b783ce237c9 (patch) | |
tree | 68338fb6f9dc72cfaf8ee0ef5ef6cc572f613403 /tests/loop.py | |
parent | ab823cc9836b8f3ec7cdd916f0dc53f0096e1c59 (diff) | |
parent | 068b0914e396e8a47e28245a0a69ea7bf6bea6ff (diff) |
Merge branch '2.1' into 2.2
Foregoes a handful of unblackened bits to make the merge easier; will
blacken next anyways
Diffstat (limited to 'tests/loop.py')
-rw-r--r-- | tests/loop.py | 14 |
1 files changed, 5 insertions, 9 deletions
diff --git a/tests/loop.py b/tests/loop.py index e805ad96..dd1f5a0c 100644 --- a/tests/loop.py +++ b/tests/loop.py @@ -16,21 +16,19 @@ # along with Paramiko; if not, write to the Free Software Foundation, Inc., # 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. -""" -... -""" +import socket +import threading -import threading, socket from paramiko.common import asbytes -class LoopSocket (object): +class LoopSocket(object): """ A LoopSocket looks like a normal socket, but all data written to it is delivered on the read-end of another LoopSocket, and vice versa. It's like a software "socketpair". """ - + def __init__(self): self.__in_buffer = bytes() self.__lock = threading.Lock() @@ -86,7 +84,7 @@ class LoopSocket (object): self.__cv.notifyAll() finally: self.__lock.release() - + def __unlink(self): m = None self.__lock.acquire() @@ -98,5 +96,3 @@ class LoopSocket (object): self.__lock.release() if m is not None: m.__unlink() - - |