Skip to content

Commit

Permalink
👹 Feed the hobgoblins (delint).
Browse files Browse the repository at this point in the history
Suppress B018 errors where they occur. Ref astral-sh/ruff#10536.
  • Loading branch information
jaraco committed Mar 23, 2024
1 parent 7881db6 commit 3a8ad34
Show file tree
Hide file tree
Showing 5 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion keyring/backend.py
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ def priority(self) -> float:
@properties.classproperty
def viable(cls):
with errors.ExceptionRaisedContext() as exc:
cls.priority
cls.priority # noqa: B018
return not exc

@classmethod
Expand Down
2 changes: 1 addition & 1 deletion keyring/backends/SecretService.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ class Keyring(backend.SchemeSelectable, KeyringBackend):
@properties.classproperty
def priority(cls) -> float:
with ExceptionRaisedContext() as exc:
secretstorage.__name__
secretstorage.__name__ # noqa: B018
if exc:
raise RuntimeError("SecretStorage required")
if secretstorage.__version_tuple__ < (3, 2):
Expand Down
4 changes: 2 additions & 2 deletions keyring/backends/Windows.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,14 +11,14 @@
from win32ctypes.pywin32 import pywintypes, win32cred

# force demand import to raise ImportError
win32cred.__name__
win32cred.__name__ # noqa: B018
except ImportError:
# fallback to pywin32
import pywintypes
import win32cred

# force demand import to raise ImportError
win32cred.__name__
win32cred.__name__ # noqa: B018

log = logging.getLogger(__name__)

Expand Down
2 changes: 1 addition & 1 deletion keyring/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ def load_keyring(keyring_name: str) -> backend.KeyringBackend:
"""
class_ = _load_keyring_class(keyring_name)
# invoke the priority to ensure it is viable, or raise a RuntimeError
class_.priority
class_.priority # noqa: B018
return class_()


Expand Down
2 changes: 1 addition & 1 deletion keyring/testing/backend.py
Original file line number Diff line number Diff line change
Expand Up @@ -174,4 +174,4 @@ def test_new_with_properties(self):
assert alt is not self.keyring
assert alt.foo == 'bar'
with pytest.raises(AttributeError):
self.keyring.foo
self.keyring.foo # noqa: B018

0 comments on commit 3a8ad34

Please sign in to comment.