From: Kaliko Jack Date: Sun, 4 Feb 2024 16:38:49 +0000 (+0100) Subject: f-string conversion X-Git-Tag: v0.9.0~11 X-Git-Url: https://git.kaliko.me/?a=commitdiff_plain;h=2025516f2cb5f3ac8f6e5b3c1c85174649e9dbd1;p=python-musicpd.git f-string conversion --- diff --git a/musicpd.py b/musicpd.py index e61188d..8b5d789 100644 --- a/musicpd.py +++ b/musicpd.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# SPDX-FileCopyrightText: 2012-2023 kaliko +# SPDX-FileCopyrightText: 2012-2024 kaliko # SPDX-FileCopyrightText: 2021 Wonko der Verständige # SPDX-FileCopyrightText: 2019 Naglis Jonaitis # SPDX-FileCopyrightText: 2019 Bart Van Loon @@ -436,9 +436,9 @@ class MPDClient: parts = [command] for arg in args: if isinstance(arg, tuple): - parts.append('{0!s}'.format(Range(arg))) + parts.append(f'{Range(arg)!s}') else: - parts.append('"%s"' % escape(str(arg))) + parts.append(f'"{escape(str(arg))}"') if '\n' in ' '.join(parts): raise CommandError('new line found in the command!') self._write_line(" ".join(parts))