Skip to content

Commit

Permalink
[fix] Duplicate ctx_ThisDir in the other main() files
Browse files Browse the repository at this point in the history
  • Loading branch information
Andy C committed Jul 17, 2021
1 parent 538bceb commit 41edd84
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 10 deletions.
11 changes: 6 additions & 5 deletions core/oven.py
Expand Up @@ -468,11 +468,12 @@ def Main(lang, arg_r, environ, login_shell, loader, line_input):
if flag.parser_mem_dump is not None:
e_usage('--parser-mem-dump can only be used with -n')

try:
status = main_loop.Batch(cmd_ev, c_parser, arena,
cmd_flags=cmd_eval.IsMainProgram)
except util.UserExit as e:
status = e.status
with state.ctx_ThisDir(mem, script_name):
try:
status = main_loop.Batch(cmd_ev, c_parser, arena,
cmd_flags=cmd_eval.IsMainProgram)
except util.UserExit as e:
status = e.status
box = [status]
cmd_ev.MaybeRunExitTrap(box)
status = box[0]
Expand Down
11 changes: 6 additions & 5 deletions core/shell_native.py
Expand Up @@ -470,11 +470,12 @@ def Main(lang, arg_r, environ, login_shell, loader, line_input):
if flag.parser_mem_dump is not None:
e_usage('--parser-mem-dump can only be used with -n')

try:
status = main_loop.Batch(cmd_ev, c_parser, arena,
cmd_flags=cmd_eval.IsMainProgram)
except util.UserExit as e:
status = e.status
with state.ctx_ThisDir(mem, script_name):
try:
status = main_loop.Batch(cmd_ev, c_parser, arena,
cmd_flags=cmd_eval.IsMainProgram)
except util.UserExit as e:
status = e.status
box = [status]
cmd_ev.MaybeRunExitTrap(box)
status = box[0]
Expand Down

0 comments on commit 41edd84

Please sign in to comment.