Skip to content

Commit

Permalink
C0209: Formatting a regular string with f-string
Browse files Browse the repository at this point in the history
  • Loading branch information
henryborchers committed Oct 6, 2023
1 parent 9561971 commit 5084196
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions hathizip/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,10 @@ def destination_path(path: str) -> str:
"""
if not os.path.exists(path):
raise ValueError("{} is an invalid path".format(path))
raise ValueError(f"{path} is an invalid path")

if not os.path.isdir(path):
raise ValueError("{} is not a path".format(path))
raise ValueError(f"{path} is not a path")

return os.path.abspath(path)

Expand Down
4 changes: 2 additions & 2 deletions hathizip/process.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ def compress_folder(path: str, dst: str) -> None:
logger.debug("Taking care of %s", path)

last_path = os.path.normcase(path).split(os.path.sep)[-1]
zipname = "{}.zip".format(last_path)
zipname = f"{last_path}.zip"

with tempfile.TemporaryDirectory() as temp_dir:
tmp_zip = os.path.join(temp_dir, zipname)
Expand Down Expand Up @@ -80,7 +80,7 @@ def compress_folder_inplace(path: str, dst: str) -> None:
logger.debug("Taking care of %s", path)

last_path = os.path.normcase(path).split(os.path.sep)[-1]
zipname = "{}.zip".format(last_path)
zipname = f"{last_path}.zip"

temp_zipname = os.path.join(dst, "processing.dat")

Expand Down

0 comments on commit 5084196

Please sign in to comment.