mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-11-30 07:47:36 +01:00
Minor Python cleanups to make flake8 pass with the new rules enabled
This commit is contained in:
@@ -4,12 +4,14 @@
|
||||
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
|
||||
"""Dummy Socks5 server for testing."""
|
||||
|
||||
import socket, threading, queue
|
||||
import socket
|
||||
import threading
|
||||
import queue
|
||||
import logging
|
||||
|
||||
logger = logging.getLogger("TestFramework.socks5")
|
||||
|
||||
### Protocol constants
|
||||
# Protocol constants
|
||||
class Command:
|
||||
CONNECT = 0x01
|
||||
|
||||
@@ -18,7 +20,7 @@ class AddressType:
|
||||
DOMAINNAME = 0x03
|
||||
IPV6 = 0x04
|
||||
|
||||
### Utility functions
|
||||
# Utility functions
|
||||
def recvall(s, n):
|
||||
"""Receive n bytes from a socket, or fail."""
|
||||
rv = bytearray()
|
||||
@@ -30,7 +32,7 @@ def recvall(s, n):
|
||||
n -= len(d)
|
||||
return rv
|
||||
|
||||
### Implementation classes
|
||||
# Implementation classes
|
||||
class Socks5Configuration():
|
||||
"""Proxy configuration."""
|
||||
def __init__(self):
|
||||
@@ -141,7 +143,7 @@ class Socks5Server():
|
||||
thread = threading.Thread(None, conn.handle)
|
||||
thread.daemon = True
|
||||
thread.start()
|
||||
|
||||
|
||||
def start(self):
|
||||
assert(not self.running)
|
||||
self.running = True
|
||||
|
||||
Reference in New Issue
Block a user