From 69eef72b0e7a540ae00abb6a65e749cfce4d532a Mon Sep 17 00:00:00 2001 From: Ray Luo Date: Fri, 12 Nov 2021 00:18:13 -0800 Subject: [PATCH] Shut pylint up --- msal_extensions/cache_lock.py | 5 ++--- msal_extensions/osx.py | 9 ++++----- msal_extensions/persistence.py | 2 +- 3 files changed, 7 insertions(+), 9 deletions(-) diff --git a/msal_extensions/cache_lock.py b/msal_extensions/cache_lock.py index 6aeb9a0..ebb2601 100644 --- a/msal_extensions/cache_lock.py +++ b/msal_extensions/cache_lock.py @@ -5,7 +5,6 @@ import time import logging from distutils.version import LooseVersion -import warnings import portalocker @@ -58,7 +57,7 @@ def __enter__(self): if not self._try_to_create_lock_file(): logger.warning("Process %d failed to create lock file", pid) file_handle = self._lock.__enter__() - file_handle.write('{} {}'.format(pid, sys.argv[0]).encode('utf-8')) + file_handle.write('{} {}'.format(pid, sys.argv[0]).encode('utf-8')) # pylint: disable=consider-using-f-string return file_handle def __exit__(self, *args): @@ -69,5 +68,5 @@ def __exit__(self, *args): # file for itself. os.remove(self._lockpath) except OSError as ex: # pylint: disable=invalid-name - if ex.errno != errno.ENOENT and ex.errno != errno.EACCES: + if ex.errno not in (errno.ENOENT, errno.EACCES): raise diff --git a/msal_extensions/osx.py b/msal_extensions/osx.py index ef1a2cc..c2e8448 100644 --- a/msal_extensions/osx.py +++ b/msal_extensions/osx.py @@ -21,10 +21,9 @@ def __init__(self, exit_status): self.exit_status = exit_status # TODO: pylint: disable=fixme # use SecCopyErrorMessageString to fetch the appropriate message here. - self.message = \ - '{} ' \ - 'see https://opensource.apple.com/source/CarbonHeaders/CarbonHeaders-18.1/MacErrors.h'\ - .format(self.exit_status) + self.message = ( + '{} see https://opensource.apple.com/source/CarbonHeaders/CarbonHeaders-18.1/MacErrors.h' # pylint: disable=consider-using-f-string,line-too-long + .format(self.exit_status)) def _get_native_location(name): # type: (str) -> str @@ -33,7 +32,7 @@ def _get_native_location(name): :param name: The name of the library to be loaded. :return: The location of the library on a MacOS filesystem. """ - return '/System/Library/Frameworks/{0}.framework/{0}'.format(name) + return '/System/Library/Frameworks/{0}.framework/{0}'.format(name) # pylint: disable=consider-using-f-string # Load native MacOS libraries diff --git a/msal_extensions/persistence.py b/msal_extensions/persistence.py index 3657d98..e4b6c66 100644 --- a/msal_extensions/persistence.py +++ b/msal_extensions/persistence.py @@ -227,7 +227,7 @@ def load(self): # This happens when a load() is called before a save(). # We map it into cross-platform error for unified catching. raise PersistenceNotFound( - location="Service:{} Account:{}".format( + location="Service:{} Account:{}".format( # pylint: disable=consider-using-f-string self._service_name, self._account_name), message=( "Keychain persistence not initialized. "