diff options
author | Eli Schwartz <eschwartz@archlinux.org> | 2021-03-04 17:16:11 -0500 |
---|---|---|
committer | Eli Schwartz <eschwartz@archlinux.org> | 2021-03-04 17:16:11 -0500 |
commit | 6a0fabc6472f49621260de215f128a31ae70219b (patch) | |
tree | 6a67908358a2c5e5baa215fe0201dfe213dd8a01 /mesonbuild/cmake/client.py | |
parent | 4340bf34faca7eed8076ba4c388fbe15355f2183 (diff) | |
download | meson-6a0fabc6472f49621260de215f128a31ae70219b.zip meson-6a0fabc6472f49621260de215f128a31ae70219b.tar.gz meson-6a0fabc6472f49621260de215f128a31ae70219b.tar.bz2 |
mass rewrite of string formatting to use f-strings everywhere
performed by running "pyupgrade --py36-plus" and committing the results
Diffstat (limited to 'mesonbuild/cmake/client.py')
-rw-r--r-- | mesonbuild/cmake/client.py | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/mesonbuild/cmake/client.py b/mesonbuild/cmake/client.py index eeaab57..bcbb52e 100644 --- a/mesonbuild/cmake/client.py +++ b/mesonbuild/cmake/client.py @@ -69,7 +69,7 @@ class RequestBase(MessageBase): @staticmethod def gen_cookie() -> str: RequestBase.cookie_counter += 1 - return 'meson_{}'.format(RequestBase.cookie_counter) + return f'meson_{RequestBase.cookie_counter}' class ReplyBase(MessageBase): def __init__(self, cookie: str, in_reply_to: str) -> None: @@ -214,7 +214,7 @@ class ReplyCodeModel(ReplyBase): def log(self) -> None: mlog.log('CMake code mode:') for idx, i in enumerate(self.configs): - mlog.log('Configuration {}:'.format(idx)) + mlog.log(f'Configuration {idx}:') with mlog.nested(): i.log() @@ -274,10 +274,10 @@ class CMakeClient: msg_type = raw_data['type'] func = self.type_map.get(msg_type, None) if not func: - raise CMakeException('Recieved unknown message type "{}"'.format(msg_type)) + raise CMakeException(f'Recieved unknown message type "{msg_type}"') for i in CMAKE_MESSAGE_TYPES[msg_type]: if i not in raw_data: - raise CMakeException('Key "{}" is missing from CMake server message type {}'.format(i, msg_type)) + raise CMakeException(f'Key "{i}" is missing from CMake server message type {msg_type}') return func(raw_data) def writeMessage(self, msg: MessageBase) -> None: @@ -316,10 +316,10 @@ class CMakeClient: reply_type = data['inReplyTo'] func = self.reply_map.get(reply_type, None) if not func: - raise CMakeException('Recieved unknown reply type "{}"'.format(reply_type)) + raise CMakeException(f'Recieved unknown reply type "{reply_type}"') for i in ['cookie'] + CMAKE_REPLY_TYPES[reply_type]: if i not in data: - raise CMakeException('Key "{}" is missing from CMake server message type {}'.format(i, type)) + raise CMakeException(f'Key "{i}" is missing from CMake server message type {type}') return func(data) def resolve_reply_cmakeInputs(self, data: T.Dict[str, T.Any]) -> ReplyCMakeInputs: |