Skip to content

Commit

Permalink
chore(formatting): use f-strings instead of C-style string formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
Danipulok committed Jan 13, 2025
1 parent 9fa181a commit ce5199a
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions pixivpy3/aapi.py
Original file line number Diff line number Diff line change
Expand Up @@ -99,14 +99,16 @@ def _load_result(self, res: Response, model: type[ModelT], /) -> ModelT:
try:
return model.model_validate(json_data)
except Exception as e:
raise PixivError("_load_result() error: %s" % e, header=res.headers, body=json_data) from e
msg = f"_load_result() error: {e}"
raise PixivError(msg, header=res.headers, body=json_data) from e

@classmethod
def _load_model(cls, data: ParsedJson, model: type[ModelT], /) -> ModelT:
try:
return model.model_validate(data)
except Exception as e:
raise PixivError("_load_model() error: %s" % e, body=data) from e
msg = f"_load_model() error: {e}"
raise PixivError(msg, body=data) from e

@classmethod
def format_bool(cls, bool_value: bool | str | None) -> _BOOL:
Expand Down

0 comments on commit ce5199a

Please sign in to comment.