##// END OF EJS Templates
save and restore ps1/ps2
Jason Newton -
Show More
@@ -251,6 +251,14 b' def embed(**kwargs):'
251 251 config = load_default_config()
252 252 config.InteractiveShellEmbed = config.TerminalInteractiveShell
253 253 kwargs['config'] = config
254 #save ps1/ps2 if defined
255 ps1 = None
256 ps2 = None
257 try:
258 ps1 = sys.ps1
259 ps2 = sys.ps2
260 except AttributeError:
261 pass
254 262 #save previous instance
255 263 saved_shell_instance = InteractiveShell._instance
256 264 if saved_shell_instance is not None:
@@ -265,3 +273,6 b' def embed(**kwargs):'
265 273 cls.clear_instance()
266 274 for subclass in cls._walk_mro():
267 275 subclass._instance = saved_shell_instance
276 if ps1 is not None:
277 sys.ps1 = ps1
278 sys.ps2 = ps2
General Comments 0
You need to be logged in to leave comments. Login now