##// END OF EJS Templates
use Singleton.instance() for embed() instead of manual global...
MinRK -
Show More
@@ -264,8 +264,6 b' class InteractiveShellEmbed(TerminalInteractiveShell):'
264 264 self.user_ns = orig_user_ns
265 265 self.compile.flags = orig_compile_flags
266 266
267 _embedded_shell = None
268
269 267
270 268 def embed(**kwargs):
271 269 """Call this to embed IPython at the current point in your program.
@@ -284,7 +282,7 b' def embed(**kwargs):'
284 282 d = 40
285 283 embed
286 284
287 Full customization can be done by passing a :class:`Struct` in as the
285 Full customization can be done by passing a :class:`Config` in as the
288 286 config argument.
289 287 """
290 288 config = kwargs.get('config')
@@ -294,7 +292,5 b' def embed(**kwargs):'
294 292 config = load_default_config()
295 293 config.InteractiveShellEmbed = config.TerminalInteractiveShell
296 294 kwargs['config'] = config
297 global _embedded_shell
298 if _embedded_shell is None:
299 _embedded_shell = InteractiveShellEmbed(**kwargs)
300 _embedded_shell(header=header, stack_depth=2, compile_flags=compile_flags)
295 shell = InteractiveShellEmbed.instance(**kwargs)
296 shell(header=header, stack_depth=2, compile_flags=compile_flags)
General Comments 0
You need to be logged in to leave comments. Login now