Skip to content

Commit

Permalink
feat: Silence exception after KeyboardInterrupt
Browse files Browse the repository at this point in the history
Silence exception messages after a KeyboardInterrupt.

Closes #133
  • Loading branch information
riddell-stan committed Oct 27, 2020
1 parent 4d3a75c commit a595581
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions stan/model.py
Original file line number Diff line number Diff line change
Expand Up @@ -237,7 +237,10 @@ def is_iteration_or_elapsed_time_logger_message(msg):
save_warmup,
)

return asyncio.run(go())
try:
return asyncio.run(go())
except KeyboardInterrupt:
pass


def build(program_code, data=None, random_seed=None):
Expand Down Expand Up @@ -295,4 +298,7 @@ async def go():
constrained_param_names = sum((tuple(param["constrained_names"]) for param in params_list), ())
return Model(model_name, program_code, data, param_names, constrained_param_names, dims, random_seed)

return asyncio.run(go())
try:
return asyncio.run(go())
except KeyboardInterrupt:
pass

0 comments on commit a595581

Please sign in to comment.