From d9d56057012c66931b5d86a83ab7f772be8d7323 Mon Sep 17 00:00:00 2001 From: Tan Long Date: Wed, 12 Nov 2025 00:12:23 +0800 Subject: [PATCH 1/3] remove unused px_pos, __gone_tall, and comment --- Lib/_pyrepl/windows_console.py | 13 ------------- 1 file changed, 13 deletions(-) diff --git a/Lib/_pyrepl/windows_console.py b/Lib/_pyrepl/windows_console.py index c56dcd6d7dd434..f9f5988af0b9ef 100644 --- a/Lib/_pyrepl/windows_console.py +++ b/Lib/_pyrepl/windows_console.py @@ -249,22 +249,10 @@ def input_hook(self): def __write_changed_line( self, y: int, oldline: str, newline: str, px_coord: int ) -> None: - # this is frustrating; there's no reason to test (say) - # self.dch1 inside the loop -- but alternative ways of - # structuring this function are equally painful (I'm trying to - # avoid writing code generators these days...) minlen = min(wlen(oldline), wlen(newline)) x_pos = 0 x_coord = 0 - px_pos = 0 - j = 0 - for c in oldline: - if j >= px_coord: - break - j += wlen(c) - px_pos += 1 - # reuse the oldline as much as possible, but stop as soon as we # encounter an ESCAPE, because it might be the start of an escape # sequence @@ -358,7 +346,6 @@ def prepare(self) -> None: self.height, self.width = self.getheightwidth() self.posxy = 0, 0 - self.__gone_tall = 0 self.__offset = 0 if self.__vt_support: From 3ce7688cacad48773eb65b6129deb2ad2749501f Mon Sep 17 00:00:00 2001 From: Tan Long Date: Wed, 12 Nov 2025 00:46:03 +0800 Subject: [PATCH 2/3] blub --- .../next/Library/2025-11-12-00-45-35.gh-issue-141415.I_sVyA.rst | 1 + 1 file changed, 1 insertion(+) create mode 100644 Misc/NEWS.d/next/Library/2025-11-12-00-45-35.gh-issue-141415.I_sVyA.rst diff --git a/Misc/NEWS.d/next/Library/2025-11-12-00-45-35.gh-issue-141415.I_sVyA.rst b/Misc/NEWS.d/next/Library/2025-11-12-00-45-35.gh-issue-141415.I_sVyA.rst new file mode 100644 index 00000000000000..ffece84e8007f7 --- /dev/null +++ b/Misc/NEWS.d/next/Library/2025-11-12-00-45-35.gh-issue-141415.I_sVyA.rst @@ -0,0 +1 @@ +Remove unused variables and comment in ``_pyrepl.windows_console.py``. From 22aeb78a48a7477be523e523e3d8c4a389d63aad Mon Sep 17 00:00:00 2001 From: Tan Long Date: Wed, 12 Nov 2025 01:19:56 +0800 Subject: [PATCH 3/3] Revert "blub" This reverts commit 3ce7688cacad48773eb65b6129deb2ad2749501f. --- .../next/Library/2025-11-12-00-45-35.gh-issue-141415.I_sVyA.rst | 1 - 1 file changed, 1 deletion(-) delete mode 100644 Misc/NEWS.d/next/Library/2025-11-12-00-45-35.gh-issue-141415.I_sVyA.rst diff --git a/Misc/NEWS.d/next/Library/2025-11-12-00-45-35.gh-issue-141415.I_sVyA.rst b/Misc/NEWS.d/next/Library/2025-11-12-00-45-35.gh-issue-141415.I_sVyA.rst deleted file mode 100644 index ffece84e8007f7..00000000000000 --- a/Misc/NEWS.d/next/Library/2025-11-12-00-45-35.gh-issue-141415.I_sVyA.rst +++ /dev/null @@ -1 +0,0 @@ -Remove unused variables and comment in ``_pyrepl.windows_console.py``.