Further pleasing pylint deity

This commit is contained in:
Miroslav Stampar
2019-06-04 12:15:39 +02:00
parent c154e64a19
commit 3ac1283900
13 changed files with 41 additions and 17 deletions

View File

@@ -5,6 +5,8 @@ Copyright (c) 2006-2019 sqlmap developers (http://sqlmap.org/)
See the file 'LICENSE' for copying permission
"""
from __future__ import division
import errno
import os
import subprocess
@@ -12,7 +14,6 @@ import time
from lib.core.compat import buffer
from lib.core.settings import IS_WIN
from thirdparty import six
if IS_WIN:
try:
@@ -98,7 +99,7 @@ class Popen(subprocess.Popen):
except ValueError:
return self._close('stdin')
except (subprocess.pywintypes.error, Exception) as ex:
if (ex[0] if six.PY2 else ex.errno) in (109, errno.ESHUTDOWN):
if ex.args[0] in (109, errno.ESHUTDOWN):
return self._close('stdin')
raise
@@ -119,7 +120,7 @@ class Popen(subprocess.Popen):
except (ValueError, NameError):
return self._close(which)
except (subprocess.pywintypes.error, Exception) as ex:
if (ex[0] if six.PY2 else ex.errno) in (109, errno.ESHUTDOWN):
if ex.args[0] in (109, errno.ESHUTDOWN):
return self._close(which)
raise
@@ -137,7 +138,7 @@ class Popen(subprocess.Popen):
try:
written = os.write(self.stdin.fileno(), input)
except OSError as ex:
if (ex[0] if six.PY2 else ex.errno) == errno.EPIPE: # broken pipe
if ex.args[0] == errno.EPIPE: # broken pipe
return self._close('stdin')
raise