Skip to content

Commit

Permalink
raise error instead of sys.exit
Browse files Browse the repository at this point in the history
`sys.exit` is not an exemplary implementation when one wants to catch the error.
  • Loading branch information
njzjz authored Nov 2, 2023
1 parent 4536aa6 commit eee6632
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion dpdata/qe/scf.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ def get_cell(lines):
raise RuntimeError("parameter 'a' or 'celldm(1)' cannot be found.")
ret = np.array([[a, 0.0, 0.0], [0.0, a, 0.0], [0.0, 0.0, a]])
else:
sys.exit("ibrav > 1 not supported yet.")
raise RuntimeError("ibrav > 1 not supported yet.")

Check warning on line 58 in dpdata/qe/scf.py

View check run for this annotation

Codecov / codecov/patch

dpdata/qe/scf.py#L58

Added line #L58 was not covered by tests
return ret


Expand Down

0 comments on commit eee6632

Please sign in to comment.