Skip to content

Commit

Permalink
hilda_client: make interactive() only define the explicit variables
Browse files Browse the repository at this point in the history
  • Loading branch information
shani authored and shani committed Jul 3, 2024
1 parent b3f79f8 commit f19430b
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions hilda/hilda_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -1055,16 +1055,17 @@ def interact(self, additional_namespace: Optional[typing.Mapping] = None,
ipython_config.InteractiveShellApp.extensions = ['hilda.ipython_extensions.magics',
'hilda.ipython_extensions.events',
'hilda.ipython_extensions.keybindings']
ipython_config.InteractiveShellApp.exec_lines = ['disable_logs()']
ipython_config.InteractiveShellApp.exec_lines = ['_disable_logs()']
if startup_files is not None:
ipython_config.InteractiveShellApp.exec_files = startup_files
self.log_debug(f'Startup files - {startup_files}')

namespace = globals()
namespace.update(locals())
namespace = {}
namespace['_disable_logs'] = disable_logs
namespace['p'] = self
namespace['ui'] = self.ui_manager
namespace['cfg'] = self.configs

if additional_namespace is not None:
namespace.update(additional_namespace)
sys.argv = ['a']
Expand Down

0 comments on commit f19430b

Please sign in to comment.