From 25eb7ca836acf5ea3a56cabfba9d33b08c4a6dd5 Mon Sep 17 00:00:00 2001 From: Jeff Forcier Date: Mon, 16 Jan 2023 22:00:33 -0500 Subject: Handpick remaining-ly relevant changes from #2110 Also make 'em f-strings, which AFAIK should be comparable Closes #2110 --- paramiko/util.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'paramiko') diff --git a/paramiko/util.py b/paramiko/util.py index 76941ff4..f1e33a50 100644 --- a/paramiko/util.py +++ b/paramiko/util.py @@ -323,7 +323,7 @@ def b(s, encoding="utf8"): elif isinstance(s, str): return s.encode(encoding) else: - raise TypeError("Expected unicode or bytes, got {!r}".format(s)) + raise TypeError(f"Expected unicode or bytes, got {type(s)}") # TODO: clean this up / force callers to assume bytes OR unicode @@ -334,4 +334,4 @@ def u(s, encoding="utf8"): elif isinstance(s, str): return s else: - raise TypeError("Expected unicode or bytes, got {!r}".format(s)) + raise TypeError(f"Expected unicode or bytes, got {type(s)}") -- cgit v1.2.1