Skip to content

Commit

Permalink
raise error instead of sys.exit (#569)
Browse files Browse the repository at this point in the history
`sys.exit` is a lousy implementation when one wants to catch the error.

---------

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
  • Loading branch information
njzjz and pre-commit-ci[bot] authored Apr 3, 2024
1 parent 1dadd7e commit 8d37fbc
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions dpdata/qe/scf.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
#!/usr/bin/env python3

import os
import sys

import numpy as np

Expand Down Expand Up @@ -55,7 +54,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.")
return ret


Expand Down

0 comments on commit 8d37fbc

Please sign in to comment.