1
0
mirror of https://github.com/Mbed-TLS/mbedtls.git synced 2025-07-29 11:41:15 +03:00

Merge pull request #3118 from gilles-peskine-arm/pylint-up-to-2.4-development

Pass Pylint up to 2.4
This commit is contained in:
Gilles Peskine
2020-04-20 09:47:40 +02:00
committed by GitHub
12 changed files with 70 additions and 38 deletions

View File

@ -29,7 +29,7 @@ from types import SimpleNamespace
import xml.etree.ElementTree as ET
class AbiChecker(object):
class AbiChecker:
"""API and ABI checker."""
def __init__(self, old_version, new_version, configuration):

View File

@ -283,9 +283,13 @@ class ConfigFile(Config):
def __init__(self, filename=None):
"""Read the Mbed TLS configuration file."""
if filename is None:
for filename in self.default_path:
if os.path.lexists(filename):
for candidate in self.default_path:
if os.path.lexists(candidate):
filename = candidate
break
else:
raise Exception('Mbed TLS configuration file not found',
self.default_path)
super().__init__()
self.filename = filename
self.current_section = 'header'
@ -448,7 +452,7 @@ if __name__ == '__main__':
value = config[args.symbol]
if value:
sys.stdout.write(value + '\n')
return args.symbol not in config
return 0 if args.symbol in config else 1
elif args.command == 'set':
if not args.force and args.symbol not in config.settings:
sys.stderr.write("A #define for the symbol {} "
@ -461,6 +465,7 @@ if __name__ == '__main__':
else:
config.adapt(args.adapter)
config.write(args.write)
return 0
# Import modules only used by main only if main is defined and called.
# pylint: disable=wrong-import-position