diff --git a/unrar/rarfile.py b/unrar/rarfile.py index 0fa5bfd..519eb68 100644 --- a/unrar/rarfile.py +++ b/unrar/rarfile.py @@ -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 @@ -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 diff --git a/unrar/unrarlib.py b/unrar/unrarlib.py index 06df081..c021865 100644 --- a/unrar/unrarlib.py +++ b/unrar/unrarlib.py @@ -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(