We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 49b84a6 commit ae6875fCopy full SHA for ae6875f
Lib/_pyrepl/reader.py
@@ -297,11 +297,9 @@ def calc_screen(self) -> list[str]:
297
if self.last_refresh_cache.valid(self):
298
offset, num_common_lines = self.last_refresh_cache.get_cached_location(self)
299
300
- screen = self.last_refresh_cache.screen.copy()
301
- del screen[num_common_lines:]
302
-
303
- screeninfo = self.last_refresh_cache.screeninfo.copy()
304
- del screeninfo[num_common_lines:]
+ # Use slicing instead of del to avoid modifying the cached lists.
+ screen = self.last_refresh_cache.screen[:num_common_lines]
+ screeninfo = self.last_refresh_cache.screeninfo[:num_common_lines]
305
306
pos = self.pos
307
pos -= offset
0 commit comments