GH-102895 Add an option local_exit in code.interact to block exit() from terminating the whole process (GH-102896)

This commit is contained in:
Tian Gao 2023-10-18 11:36:43 -07:00 committed by GitHub
parent cb1bf89c40
commit e6eb8cafca
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 114 additions and 33 deletions

View file

@ -1741,7 +1741,7 @@ class Pdb(bdb.Bdb, cmd.Cmd):
contains all the (global and local) names found in the current scope.
"""
ns = {**self.curframe.f_globals, **self.curframe_locals}
code.interact("*interactive*", local=ns)
code.interact("*interactive*", local=ns, local_exit=True)
def do_alias(self, arg):
"""alias [name [command]]