From 51f0ead16d60c63d1b069f807e3513bba11d8947 Mon Sep 17 00:00:00 2001 From: Patrick Lehmann Date: Mon, 28 Nov 2022 00:32:17 +0100 Subject: Converted string formatting to f-strings. --- pyGHDL/lsp/lsp.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'pyGHDL/lsp/lsp.py') diff --git a/pyGHDL/lsp/lsp.py b/pyGHDL/lsp/lsp.py index 03b4c38e4..0b392ea84 100644 --- a/pyGHDL/lsp/lsp.py +++ b/pyGHDL/lsp/lsp.py @@ -139,7 +139,7 @@ class LanguageProtocolServer(object): log.exception("Caught exception while handling %s with params %s:", method, params) self.show_message( MessageType.Error, - ("Caught exception while handling {}, see VHDL language server output for details.").format(method), + f"Caught exception while handling {method}, see VHDL language server output for details.", ) response = None if tid is None: @@ -163,14 +163,14 @@ class LanguageProtocolServer(object): "id": tid, "error": { "code": JSONErrorCodes.MethodNotFound, - "message": "unknown method {}".format(method), + "message": f"unknown method {method}", }, } return rbody def write_output(self, body): output = json.dumps(body, separators=(",", ":")) - self.conn.write("Content-Length: {}\r\n".format(len(output))) + self.conn.write(f"Content-Length: {len(output)}\r\n") self.conn.write("\r\n") self.conn.write(output) -- cgit v1.2.3