Skip to content

Commit

Permalink
Fix the listener thread pylint errors
Browse files Browse the repository at this point in the history
************* Module osvcd_lsnr
E: 15, 0: Unable to import 'six.moves.queue' (import-error)

 => false positive: the "import six.moves.queue as queue" does work. Use
    "from six.moves import queue" instead, as it pleases pylint

E: 60,16: Undefined variable 'shutil' (undefined-variable)

 => good catch, the socket file clean up was actually silently stacking

E:781,57: Instance of 'Exception' has no 'errno' member (no-member)

 => false positive: we actually tested the existance of the errno attr before
    access. Use getattr(exc, "errno") instead of exc.errno to please pylint
  • Loading branch information
cvaroqui committed Oct 1, 2018
1 parent 0aff8f3 commit 145c723
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions lib/osvcd_lsnr.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,12 @@
import codecs
import time
import select
import shutil
from subprocess import Popen, PIPE

import six
import six.moves.queue as queue
import osvcd_shared as shared
from six.moves import queue
from rcGlobalEnv import rcEnv, Storage
from rcUtilities import bdecode, drop_option, chunker
from converters import convert_size
Expand Down Expand Up @@ -778,7 +779,7 @@ def _action_logs(self, nodename, logfile, obj, **kwargs):
try:
conn.sendall(message)
except Exception as exc:
if hasattr(exc, "errno") and exc.errno == 32:
if hasattr(exc, "errno") and getattr(exc, "errno") == 32:
# Broken pipe (client has left)
break
if backlog != 0:
Expand Down

0 comments on commit 145c723

Please sign in to comment.