Skip to content

Commit 533df80

Browse files
committed
Resolving pylint warnings
1 parent bd5bdda commit 533df80

File tree

2 files changed

+5
-4
lines changed

2 files changed

+5
-4
lines changed

src/api.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,7 @@ def serve_forever(self):
6868

6969
# This thread, of which there is only one, runs the API.
7070
class singleAPI(threading.Thread, helper_threading.StoppableThread):
71+
"""API thread"""
7172
def __init__(self):
7273
threading.Thread.__init__(self, name="singleAPI")
7374
self.initStop()
@@ -88,8 +89,8 @@ def stopThread(self):
8889
def run(self):
8990
port = BMConfigParser().getint('bitmessagesettings', 'apiport')
9091
try:
91-
from errno import WSAEADDRINUSE
92-
except (ImportError, AttributeError):
92+
getattr(errno, 'WSAEADDRINUSE')
93+
except AttributeError:
9394
errno.WSAEADDRINUSE = errno.EADDRINUSE
9495
for attempt in range(50):
9596
try:
@@ -133,7 +134,7 @@ def run(self):
133134
# Modified by Jonathan Warren (Atheros).
134135
# http://code.activestate.com/recipes/501148-xmlrpc-serverclient-which-does-cookie-handling-and/
135136
class MySimpleXMLRPCRequestHandler(SimpleXMLRPCRequestHandler):
136-
137+
"""The main API handler"""
137138
def do_POST(self):
138139
# Handles the HTTP POST request.
139140
# Attempts to interpret all HTTP POST requests as XML-RPC calls,

src/bitmessagemain.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -288,7 +288,7 @@ def start(self):
288288

289289
# API is also objproc dependent
290290
if BMConfigParser().safeGetBoolean('bitmessagesettings', 'apienabled'):
291-
import api
291+
import api # pylint: disable=relative-import
292292
singleAPIThread = api.singleAPI()
293293
# close the main program even if there are threads left
294294
singleAPIThread.daemon = True

0 commit comments

Comments
 (0)