Skip to content

Commit

Permalink
Disable lint of 3rd party
Browse files Browse the repository at this point in the history
Fixes CI failure in newer versions of py-filelock.
  • Loading branch information
john-kurkowski committed Dec 27, 2021
1 parent b298033 commit 164b63c
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions tldextract/cache.py
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,8 @@ def get(self, namespace, key):
if not os.path.isfile(cache_filepath):
raise KeyError("namespace: " + namespace + " key: " + repr(key))
try:
with open(cache_filepath) as cache_file: # pylint: disable=unspecified-encoding
# pylint: disable-next=unspecified-encoding
with open(cache_filepath) as cache_file:
return json.load(cache_file)
except (OSError, ValueError) as exc:
LOG.error("error reading TLD cache file %s: %s", cache_filepath, exc)
Expand All @@ -108,7 +109,8 @@ def set(self, namespace, key, value):

try:
_make_dir(cache_filepath)
with open(cache_filepath, "w") as cache_file: # pylint: disable=unspecified-encoding
# pylint: disable-next=unspecified-encoding
with open(cache_filepath, "w") as cache_file:
json.dump(value, cache_file)
except OSError as ioe:
global _DID_LOG_UNABLE_TO_CACHE # pylint: disable=global-statement
Expand Down Expand Up @@ -183,6 +185,8 @@ def run_and_cache(self, func, namespace, kwargs, hashed_argnames):

return func(**kwargs)

# Disable lint of 3rd party (see also https://github.com/tox-dev/py-filelock/issues/102)
# pylint: disable-next=abstract-class-instantiated
with FileLock(lock_path, timeout=self.lock_timeout):
try:
result = self.get(namespace=namespace, key=key_args)
Expand Down

0 comments on commit 164b63c

Please sign in to comment.