From 4f68e94fb3df2f6cefbee944125eb80830c6ca16 Mon Sep 17 00:00:00 2001 From: link2xt Date: Wed, 15 Feb 2023 16:33:05 +0000 Subject: [PATCH] python: use f-strings instead of percent-encoding --- python/pyproject.toml | 2 +- python/src/deltachat/account.py | 2 +- python/tests/stress_test_db.py | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/python/pyproject.toml b/python/pyproject.toml index 56c6d87f4..e1ed72bea 100644 --- a/python/pyproject.toml +++ b/python/pyproject.toml @@ -45,7 +45,7 @@ git_describe_command = "git describe --dirty --tags --long --match py-*.*" line-length = 120 [tool.ruff] -select = ["E", "F", "W", "YTT", "C4", "ISC", "ICN", "TID", "DTZ", "PLC", "PLE", "PLW", "PIE", "COM", "UP004", "UP010", "UP032"] +select = ["E", "F", "W", "YTT", "C4", "ISC", "ICN", "TID", "DTZ", "PLC", "PLE", "PLW", "PIE", "COM", "UP004", "UP010", "UP031", "UP032"] line-length = 120 [tool.isort] diff --git a/python/src/deltachat/account.py b/python/src/deltachat/account.py index 295e9d02f..61d74d793 100644 --- a/python/src/deltachat/account.py +++ b/python/src/deltachat/account.py @@ -301,7 +301,7 @@ class Account: elif isinstance(obj, str): displayname, addr = parseaddr(obj) else: - raise TypeError("don't know how to create chat for %r" % (obj,)) + raise TypeError(f"don't know how to create chat for {obj!r}") if name is None and displayname: name = displayname diff --git a/python/tests/stress_test_db.py b/python/tests/stress_test_db.py index f46bcdf65..a8b942a09 100644 --- a/python/tests/stress_test_db.py +++ b/python/tests/stress_test_db.py @@ -14,7 +14,7 @@ def test_db_busy_error(acfactory, tmpdir): def log(string): with log_lock: - print("%3.2f %s" % (time.time() - starttime, string)) + print(f"{time.time() - starttime:3.2f} {string}") # make a number of accounts accounts = acfactory.get_many_online_accounts(3)