Skip to content

Commit

Permalink
Bring try/raise inside file context
Browse files Browse the repository at this point in the history
  • Loading branch information
caleb-johnson committed Sep 24, 2024
1 parent 4440493 commit 2935a44
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions qiskit_addon_dice_solver/dice_solver.py
Original file line number Diff line number Diff line change
Expand Up @@ -190,17 +190,17 @@ def _call_dice(working_dir: Path, mpirun_options: Sequence[str] | str | None) ->
else:
dice_call = ["mpirun", dice_path]

try:
with open(dice_log_path, "w") as logfile:
with open(dice_log_path, "w") as logfile:
try:
subprocess.run(
dice_call, cwd=working_dir, stdout=logfile, stderr=logfile, check=True
)
except subprocess.CalledProcessError as e:
raise DiceExecutionError(
command=dice_call,
returncode=e.returncode,
log_path=dice_log_path,
) from e
except subprocess.CalledProcessError as e:
raise DiceExecutionError(
command=dice_call,
returncode=e.returncode,
log_path=dice_log_path,
) from e


def _write_input_files(
Expand Down

0 comments on commit 2935a44

Please sign in to comment.