summaryrefslogtreecommitdiffstats
path: root/src/prompt_toolkit/output/win32.py
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-06-05 04:45:14 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-06-05 04:45:14 +0000
commit5b43aaac61ac94abe722bc98ae58468618f2f512 (patch)
tree3d58c89faa23d194f83abb24ae1fd05067538fff /src/prompt_toolkit/output/win32.py
parentAdding upstream version 3.0.43. (diff)
downloadprompt-toolkit-5b43aaac61ac94abe722bc98ae58468618f2f512.tar.xz
prompt-toolkit-5b43aaac61ac94abe722bc98ae58468618f2f512.zip
Adding upstream version 3.0.46.upstream/3.0.46
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'src/prompt_toolkit/output/win32.py')
-rw-r--r--src/prompt_toolkit/output/win32.py12
1 files changed, 6 insertions, 6 deletions
diff --git a/src/prompt_toolkit/output/win32.py b/src/prompt_toolkit/output/win32.py
index edeca09..83ccea4 100644
--- a/src/prompt_toolkit/output/win32.py
+++ b/src/prompt_toolkit/output/win32.py
@@ -73,11 +73,11 @@ class NoConsoleScreenBufferError(Exception):
if xterm:
message = (
- "Found %s, while expecting a Windows console. "
+ "Found {}, while expecting a Windows console. "
'Maybe try to run this program using "winpty" '
"or run it in cmd.exe instead. Or otherwise, "
"in case of Cygwin, use the Python executable "
- "that is compiled for Cygwin." % os.environ["TERM"]
+ "that is compiled for Cygwin.".format(os.environ["TERM"])
)
else:
message = "No Windows console found. Are you running cmd.exe?"
@@ -163,13 +163,13 @@ class Win32Output(Output):
self.flush()
if _DEBUG_RENDER_OUTPUT:
- self.LOG.write(("%r" % func.__name__).encode("utf-8") + b"\n")
+ self.LOG.write((f"{func.__name__!r}").encode() + b"\n")
self.LOG.write(
- b" " + ", ".join(["%r" % i for i in a]).encode("utf-8") + b"\n"
+ b" " + ", ".join([f"{i!r}" for i in a]).encode("utf-8") + b"\n"
)
self.LOG.write(
b" "
- + ", ".join(["%r" % type(i) for i in a]).encode("utf-8")
+ + ", ".join([f"{type(i)!r}" for i in a]).encode("utf-8")
+ b"\n"
)
self.LOG.flush()
@@ -370,7 +370,7 @@ class Win32Output(Output):
data = "".join(self._buffer)
if _DEBUG_RENDER_OUTPUT:
- self.LOG.write(("%r" % data).encode("utf-8") + b"\n")
+ self.LOG.write((f"{data!r}").encode() + b"\n")
self.LOG.flush()
# Print characters one by one. This appears to be the best solution