diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index a6e1d7d5..c3e7ad39 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -42,7 +42,7 @@ repos: files: ^(.*\.toml)$ - repo: https://github.com/astral-sh/ruff-pre-commit - rev: v0.1.14 + rev: v0.3.4 hooks: - id: ruff args: [ --exit-non-zero-on-fix, --fix ] @@ -51,7 +51,7 @@ repos: - repo: https://github.com/psf/black hooks: - id: black - rev: 24.1.1 + rev: 24.3.0 - repo: https://github.com/LilSpazJoekp/docstrfmt hooks: diff --git a/asyncpraw/models/reddit/base.py b/asyncpraw/models/reddit/base.py index 6eed4e1d..dfc7fb2f 100644 --- a/asyncpraw/models/reddit/base.py +++ b/asyncpraw/models/reddit/base.py @@ -35,9 +35,7 @@ def __eq__(self, other: Any | str) -> bool: def __getattr__(self, attribute: str) -> Any: """Return the value of ``attribute``.""" if not attribute.startswith("_") and not self._fetched: - msg = "{0!r} object has no attribute {1!r}. {0!r} object has not been fetched, did you forget to execute '.load()'?".format( - self.__class__.__name__, attribute - ) + msg = f"{self.__class__.__name__!r} object has no attribute {attribute!r}. {self.__class__.__name__!r} object has not been fetched, did you forget to execute '.load()'?" raise AttributeError(msg) msg = f"{self.__class__.__name__!r} object has no attribute {attribute!r}" raise AttributeError(msg)