Commit 640867cb authored by Jason Madden's avatar Jason Madden

Clean up warnings in subprocess.py. Disable mccabe check for now.

parent e820c958
...@@ -35,6 +35,12 @@ ignore-patterns: ...@@ -35,6 +35,12 @@ ignore-patterns:
pyroma: pyroma:
run: true run: true
mccabe:
# We have way too many violations of the complexity measure.
# We should enable this and fix them one at a time, but that's
# more refactoring than I want to do initially.
run: false
pyflakes: pyflakes:
disable: disable:
# F821: undefined name; caught better by pylint, where it can be # F821: undefined name; caught better by pylint, where it can be
......
...@@ -21,6 +21,15 @@ Cooperative ``subprocess`` module. ...@@ -21,6 +21,15 @@ Cooperative ``subprocess`` module.
.. _is not defined: http://www.linuxprogrammingblog.com/all-about-linux-signals?page=11 .. _is not defined: http://www.linuxprogrammingblog.com/all-about-linux-signals?page=11
""" """
from __future__ import absolute_import, print_function from __future__ import absolute_import, print_function
# Can we split this up to make it cleaner? See https://github.com/gevent/gevent/issues/748
# pylint: disable=too-many-lines
# Import magic
# pylint: disable=undefined-all-variable,undefined-variable
# Most of this we inherit from the standard lib
# pylint: disable=bare-except,too-many-locals,too-many-statements,bad-builtin,attribute-defined-outside-init
# pylint: disable=too-many-branches,too-many-instance-attributes
# Most of this is cross-platform
# pylint: disable=no-member,expression-not-assigned,unused-argument,unused-variable
import errno import errno
import gc import gc
import io import io
...@@ -155,7 +164,7 @@ __all__ = __implements__ + __imports__ ...@@ -155,7 +164,7 @@ __all__ = __implements__ + __imports__
mswindows = sys.platform == 'win32' mswindows = sys.platform == 'win32'
if mswindows: if mswindows:
import msvcrt import msvcrt # pylint: disable=import-error
if PY3: if PY3:
class Handle(int): class Handle(int):
closed = False closed = False
...@@ -394,7 +403,7 @@ class Popen(object): ...@@ -394,7 +403,7 @@ class Popen(object):
# POSIX # POSIX
if close_fds is _PLATFORM_DEFAULT_CLOSE_FDS: if close_fds is _PLATFORM_DEFAULT_CLOSE_FDS:
# close_fds has different defaults on Py3/Py2 # close_fds has different defaults on Py3/Py2
if PY3: if PY3: # pylint: disable=simplifiable-if-statement
close_fds = True close_fds = True
else: else:
close_fds = False close_fds = False
...@@ -669,7 +678,7 @@ class Popen(object): ...@@ -669,7 +678,7 @@ class Popen(object):
def __enter__(self): def __enter__(self):
return self return self
def __exit__(self, type, value, traceback): def __exit__(self, t, v, tb):
if self.stdout: if self.stdout:
self.stdout.close() self.stdout.close()
if self.stderr: if self.stderr:
......
[pep8] [pep8]
# N801: class names should use CapWords # N801: class names should use CapWords
ignore=E702,E265,E402,E731,E266,E261,W503,E129,N801 # N802: function names should be lower-case; comes from Windows funcs
ignore=E702,E265,E402,E731,E266,E261,W503,E129,N801,N802
max_line_length=160 max_line_length=160
exclude=.runtimes,.eggs,.tox,.git,build,2.6,2.7,2.7pypy,3.3,3.5,test_support.py,test_queue.py,patched_tests_setup.py,test_threading_2.py,lock_tests.py,_sslgte279.py,3.4 exclude=.runtimes,.eggs,.tox,.git,build,2.6,2.7,2.7pypy,3.3,3.5,test_support.py,test_queue.py,patched_tests_setup.py,test_threading_2.py,lock_tests.py,_sslgte279.py,3.4
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment