Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

change str.format() to f-strings #27

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions unrar/rarfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@ def __init__(self, filename, mode='r', pwd=None):
self.comment = None
self._load_metadata(handle)
self._close(handle)

def __enter__(self):
return self

Expand Down Expand Up @@ -388,7 +388,7 @@ def main(args=None):
rf = RarFile(args[1], 'r')
err = rf.testrar()
if err:
print("The following enclosed file is corrupted: {!r}".format(err))
print(f"The following enclosed file is corrupted: {err!r}")
print("Done testing")
elif cmd == '-e':
# extract
Expand Down
3 changes: 1 addition & 2 deletions unrar/unrarlib.py
Original file line number Diff line number Diff line change
Expand Up @@ -63,8 +63,7 @@
# find latest available version
latest_version = max(
version.parse(v) for v in os.listdir(BREW_UNRAR_PATH))
lib_path = "{}{}/lib/{}".format(
BREW_UNRAR_PATH, latest_version, LIB_FILENAME)
lib_path = f"{BREW_UNRAR_PATH}{latest_version}/lib/{LIB_FILENAME}"
unrarlib = ctypes.cdll.LoadLibrary(lib_path)
else:
raise LookupError(
Expand Down