gh-118877: Fix AssertionError crash in pyrepl (#118936)

This commit is contained in:
Daniel Hollas 2024-05-20 19:21:56 +01:00 committed by GitHub
parent 7e1a130b8f
commit c0d81b2566
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 25 additions and 4 deletions

View file

@ -34,9 +34,7 @@ import os
# types
if False:
from .reader import Reader
from .historical_reader import HistoricalReader
from .console import Event
class Command:
@ -245,7 +243,7 @@ class up(MotionCommand):
x, y = r.pos2xy()
new_y = y - 1
if new_y < 0:
if r.bol() == 0:
if r.historyi > 0:
r.select_item(r.historyi - 1)
return