summaryrefslogtreecommitdiffstats
path: root/Lib/_pyrepl/reader.py
diff options
context:
space:
mode:
Diffstat (limited to 'Lib/_pyrepl/reader.py')
-rw-r--r--Lib/_pyrepl/reader.py5
1 files changed, 5 insertions, 0 deletions
diff --git a/Lib/_pyrepl/reader.py b/Lib/_pyrepl/reader.py
index 0f0ef15..1c816d5 100644
--- a/Lib/_pyrepl/reader.py
+++ b/Lib/_pyrepl/reader.py
@@ -238,6 +238,7 @@ class Reader:
cxy: tuple[int, int] = field(init=False)
lxy: tuple[int, int] = field(init=False)
calc_screen: CalcScreen = field(init=False)
+ scheduled_commands: list[str] = field(default_factory=list)
def __post_init__(self) -> None:
# Enable the use of `insert` without a `prepare` call - necessary to
@@ -557,6 +558,10 @@ class Reader:
self.restore()
raise
+ while self.scheduled_commands:
+ cmd = self.scheduled_commands.pop()
+ self.do_cmd((cmd, []))
+
def last_command_is(self, cls: type) -> bool:
if not self.last_command:
return False