From b34a34ec34c67eb88220a62166fe83994217fb91 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniele=20Trifir=C3=B2?= Date: Thu, 28 Apr 2022 08:57:22 +0200 Subject: [PATCH] fs, pygit2: add missing f-string formatter for error messages --- scmrepo/fs.py | 2 +- scmrepo/git/backend/pygit2.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/scmrepo/fs.py b/scmrepo/fs.py index b0908cd8..09d0ceb7 100644 --- a/scmrepo/fs.py +++ b/scmrepo/fs.py @@ -90,7 +90,7 @@ def _open( obj.size = bytesio_len(obj) return obj except KeyError as exc: - msg = os.strerror(errno.ENOENT) + f"in branch '{self.rev}'" + msg = os.strerror(errno.ENOENT) + f" in branch '{self.rev}'" raise FileNotFoundError(errno.ENOENT, msg, path) from exc except IsADirectoryError as exc: raise IsADirectoryError( diff --git a/scmrepo/git/backend/pygit2.py b/scmrepo/git/backend/pygit2.py index 58e6e3b0..d483efc8 100644 --- a/scmrepo/git/backend/pygit2.py +++ b/scmrepo/git/backend/pygit2.py @@ -646,7 +646,7 @@ def merge( return str(obj.id) if ff_pref & GIT_MERGE_PREFERENCE_FASTFORWARD_ONLY: - raise SCMError("Cannot fast-forward HEAD to '{rev}'") + raise SCMError(f"Cannot fast-forward HEAD to '{rev}'") if commit: if not msg: