Skip to content

Commit

Permalink
correction from "ruff" tool
Browse files Browse the repository at this point in the history
Signed-off-by: Alexander Piskun <[email protected]>
  • Loading branch information
bigcat88 committed Apr 23, 2024
1 parent f60beb5 commit 63ed4f3
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 3 deletions.
3 changes: 1 addition & 2 deletions pillow_heif/misc.py
Original file line number Diff line number Diff line change
Expand Up @@ -432,8 +432,7 @@ def save(self, fp) -> None:
"""Ask encoder to produce output based on previously added images."""
data = self.ctx_write.finalize()
if isinstance(fp, (str, Path)):
with builtins.open(fp, "wb") as f:
f.write(data)
Path(fp).write_bytes(data)
elif hasattr(fp, "write"):
fp.write(data)
else:
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ lint.extend-ignore = ["D107", "D105", "D203", "D213", "D401", "E203", "I001", "R
"docs/**/*.py" = ["D"]
"examples/**/*.py" = ["D", "PERF"]
"libheif/**/*.py" = ["D", "PERF", "S"]
"tests/**/*.py" = ["B009", "D", "E402", "PERF", "S", "UP"]
"tests/**/*.py" = ["B009", "D", "E402", "PERF", "S", "UP", "SIM115"]

[tool.ruff.lint.mccabe]
max-complexity = 16
Expand Down

0 comments on commit 63ed4f3

Please sign in to comment.