Skip to content

Commit d9277d0

Browse files
committed
Restoring full functionality of StdSim after command finalization hooks
1 parent 27c054a commit d9277d0

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

cmd2/cmd2.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1801,6 +1801,12 @@ def _run_cmdfinalization_hooks(self, stop: bool, statement: Optional[Statement])
18011801
return data.stop
18021802
except Exception as ex:
18031803
self.perror(ex)
1804+
finally:
1805+
with self.sigint_protection:
1806+
if self._in_py:
1807+
# Restore ability to save output now that the command finalization hooks are done
1808+
self.stdout.pause_storage = False
1809+
sys.stderr.pause_storage = False
18041810

18051811
def runcmds_plus_hooks(self, cmds: List[str]) -> bool:
18061812
"""Convenience method to run multiple commands by onecmd_plus_hooks.

0 commit comments

Comments
 (0)