diff options
author | MarcoFalke <falke.marco@gmail.com> | 2017-02-23 16:39:14 +0100 |
---|---|---|
committer | MarcoFalke <falke.marco@gmail.com> | 2017-02-23 16:39:22 +0100 |
commit | d6064a89ac97dc0d2ce9da3982e1a4e25afaeda8 (patch) | |
tree | 824034a5baf053cfc624a4cf74bd21e1d73c8056 /qa/rpc-tests/test_framework/socks5.py | |
parent | 7146d96de3e15a80cafbab2af48ff6f65d8e41bb (diff) | |
parent | 3f95a806b1cd2f3c944bda7bcc266498a59326e4 (diff) |
Merge #9577: Fix docstrings in qa tests
3f95a80 Fix docstrings in qa tests (John Newbery)
Diffstat (limited to 'qa/rpc-tests/test_framework/socks5.py')
-rw-r--r-- | qa/rpc-tests/test_framework/socks5.py | 14 |
1 files changed, 5 insertions, 9 deletions
diff --git a/qa/rpc-tests/test_framework/socks5.py b/qa/rpc-tests/test_framework/socks5.py index 372f5ed605..450bf3775e 100644 --- a/qa/rpc-tests/test_framework/socks5.py +++ b/qa/rpc-tests/test_framework/socks5.py @@ -2,9 +2,7 @@ # Copyright (c) 2015-2016 The Bitcoin Core developers # Distributed under the MIT software license, see the accompanying # file COPYING or http://www.opensource.org/licenses/mit-license.php. -''' -Dummy Socks5 server for testing. -''' +"""Dummy Socks5 server for testing.""" import socket, threading, queue import traceback, sys @@ -20,7 +18,7 @@ class AddressType: ### Utility functions def recvall(s, n): - '''Receive n bytes from a socket, or fail''' + """Receive n bytes from a socket, or fail.""" rv = bytearray() while n > 0: d = s.recv(n) @@ -32,7 +30,7 @@ def recvall(s, n): ### Implementation classes class Socks5Configuration(object): - '''Proxy configuration''' + """Proxy configuration.""" def __init__(self): self.addr = None # Bind address (must be set) self.af = socket.AF_INET # Bind address family @@ -40,7 +38,7 @@ class Socks5Configuration(object): self.auth = False # Support authentication class Socks5Command(object): - '''Information about an incoming socks5 command''' + """Information about an incoming socks5 command.""" def __init__(self, cmd, atyp, addr, port, username, password): self.cmd = cmd # Command (one of Command.*) self.atyp = atyp # Address type (one of AddressType.*) @@ -58,9 +56,7 @@ class Socks5Connection(object): self.peer = peer def handle(self): - ''' - Handle socks5 request according to RFC1928 - ''' + """Handle socks5 request according to RFC192.""" try: # Verify socks version ver = recvall(self.conn, 1)[0] |