Silence pylint

Silence pylint in specific places where we're doing slightly unusual
or dodgy, but correct.
This commit is contained in:
Gilles Peskine 2019-02-25 21:39:42 +01:00
parent 23e64f226b
commit e915d532a6
4 changed files with 9 additions and 4 deletions

View File

@ -268,7 +268,9 @@ def run_main():
)
return_code = abi_check.check_for_abi_changes()
sys.exit(return_code)
except Exception:
except Exception: # pylint: disable=broad-except
# Print the backtrace and exit explicitly so as to exit with
# status 2, not 1.
traceback.print_exc()
sys.exit(2)

View File

@ -238,7 +238,7 @@ class FileWrapper(io.FileIO, object):
if hasattr(parent, '__next__'):
line = parent.__next__() # Python 3
else:
line = parent.next() # Python 2
line = parent.next() # Python 2 # pylint: disable=no-member
if line is not None:
self._line_no += 1
# Convert byte array to string with correct encoding and

View File

@ -37,7 +37,8 @@ https://github.com/ARMmbed/greentea
import re
import os
import binascii
from mbed_host_tests import BaseHostTest, event_callback
from mbed_host_tests import BaseHostTest, event_callback # pylint: disable=import-error
class TestDataParserError(Exception):

View File

@ -22,7 +22,7 @@
Unit tests for generate_test_code.py
"""
# pylint: disable=wrong-import-order
try:
# Python 2
from StringIO import StringIO
@ -36,6 +36,7 @@ try:
except ImportError:
# Python 3
from unittest.mock import patch
# pylint: enable=wrong-import-order
from generate_test_code import gen_dependencies, gen_dependencies_one_line
from generate_test_code import gen_function_wrapper, gen_dispatch
from generate_test_code import parse_until_pattern, GeneratorInputError
@ -336,6 +337,7 @@ class StringIOWrapper(StringIO, object):
:param length:
:return:
"""
# pylint: disable=unused-argument
line = super(StringIOWrapper, self).readline()
if line is not None:
self.line_no += 1