diff --git a/spyder_kernels/console/start.py b/spyder_kernels/console/start.py index dfb38818..55610234 100644 --- a/spyder_kernels/console/start.py +++ b/spyder_kernels/console/start.py @@ -224,7 +224,8 @@ def kernel_config(): use_file_o = os.environ.get('SPY_USE_FILE_O') run_file_o = os.environ.get('SPY_RUN_FILE_O') if use_file_o == 'True' and run_file_o is not None: - spy_cfg.IPKernelApp.file_to_run = run_file_o + if osp.exists(run_file_o): + spy_cfg.IPKernelApp.file_to_run = run_file_o # Autocall autocall_o = os.environ.get('SPY_AUTOCALL_O')