File tree Expand file tree Collapse file tree 2 files changed +5
-4
lines changed Expand file tree Collapse file tree 2 files changed +5
-4
lines changed Original file line number Diff line number Diff line change @@ -68,6 +68,7 @@ def serve_forever(self):
68
68
69
69
# This thread, of which there is only one, runs the API.
70
70
class singleAPI (threading .Thread , helper_threading .StoppableThread ):
71
+ """API thread"""
71
72
def __init__ (self ):
72
73
threading .Thread .__init__ (self , name = "singleAPI" )
73
74
self .initStop ()
@@ -88,8 +89,8 @@ def stopThread(self):
88
89
def run (self ):
89
90
port = BMConfigParser ().getint ('bitmessagesettings' , 'apiport' )
90
91
try :
91
- from errno import WSAEADDRINUSE
92
- except ( ImportError , AttributeError ) :
92
+ getattr ( errno , ' WSAEADDRINUSE' )
93
+ except AttributeError :
93
94
errno .WSAEADDRINUSE = errno .EADDRINUSE
94
95
for attempt in range (50 ):
95
96
try :
@@ -133,7 +134,7 @@ def run(self):
133
134
# Modified by Jonathan Warren (Atheros).
134
135
# http://code.activestate.com/recipes/501148-xmlrpc-serverclient-which-does-cookie-handling-and/
135
136
class MySimpleXMLRPCRequestHandler (SimpleXMLRPCRequestHandler ):
136
-
137
+ """The main API handler"""
137
138
def do_POST (self ):
138
139
# Handles the HTTP POST request.
139
140
# Attempts to interpret all HTTP POST requests as XML-RPC calls,
Original file line number Diff line number Diff line change @@ -288,7 +288,7 @@ def start(self):
288
288
289
289
# API is also objproc dependent
290
290
if BMConfigParser ().safeGetBoolean ('bitmessagesettings' , 'apienabled' ):
291
- import api
291
+ import api # pylint: disable=relative-import
292
292
singleAPIThread = api .singleAPI ()
293
293
# close the main program even if there are threads left
294
294
singleAPIThread .daemon = True
You can’t perform that action at this time.
0 commit comments