From f19430b3582b66a41bfbf872749971440d583c17 Mon Sep 17 00:00:00 2001 From: shani Date: Tue, 2 Jul 2024 22:27:38 -0700 Subject: [PATCH] hilda_client: make `interactive()` only define the explicit variables --- hilda/hilda_client.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/hilda/hilda_client.py b/hilda/hilda_client.py index f980228..cc3d84d 100644 --- a/hilda/hilda_client.py +++ b/hilda/hilda_client.py @@ -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']