diff options
author | Andrej Shadura <andrew@shadura.me> | 2023-02-26 22:34:19 +0100 |
---|---|---|
committer | Andrej Shadura <andrew@shadura.me> | 2023-02-26 22:34:19 +0100 |
commit | ca204392d584ad5590f522a2c554d44865d10263 (patch) | |
tree | 71fbb1c2465caf50c06ddd019cb3c9c52c236ff8 /git_crecord/main.py | |
parent | bb52c3cd960a60383a874ab31fcfc3101cd1bd67 (diff) |
Use f-strings in more places instead of %-formatting
Diffstat (limited to 'git_crecord/main.py')
-rw-r--r-- | git_crecord/main.py | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/git_crecord/main.py b/git_crecord/main.py index 5676885..9d25212 100644 --- a/git_crecord/main.py +++ b/git_crecord/main.py @@ -25,7 +25,7 @@ class Config: def get(self, section, item, default=None) -> Optional[str]: try: return systemcall( - ['git', 'config', '--get', '%s.%s' % (section, item)], + ['git', 'config', '--get', f'{section}.{item}'], onerr=KeyError, encoding="UTF-8", ).rstrip('\n') @@ -89,7 +89,7 @@ class Ui: editor = self.editor system( - '%s "%s"' % (editor, f.name), onerr=Abort, errprefix=_("edit failed"), + f'{editor} "{f.name}"', onerr=Abort, errprefix=_("edit failed"), ) t = Path(f.name).read_bytes() @@ -140,7 +140,7 @@ class Ui: if v is True: args.append("--%s" % k.replace("_", "-")) else: - args.append("--%s=%s" % (k.replace("_", "-"), v)) + args.append("--{}={}".format(k.replace("_", "-"), v)) to_add = [f for f in files if os.path.exists(f)] if to_add: |