mirror of
https://gitlab.com/dslackw/slpkg.git
synced 2025-01-16 03:41:11 +01:00
Fixed for stderr exit code
This commit is contained in:
parent
d53d45aab8
commit
17a4c03048
1 changed files with 4 additions and 1 deletions
|
@ -157,10 +157,13 @@ class Utilities:
|
|||
def process(command: str, stderr=None, stdout=None) -> None:
|
||||
""" Handle the processes. """
|
||||
try:
|
||||
subprocess.call(command, shell=True, stderr=stderr, stdout=stdout)
|
||||
output = subprocess.call(command, shell=True, stderr=stderr, stdout=stdout)
|
||||
except (KeyboardInterrupt, subprocess.CalledProcessError) as err:
|
||||
raise SystemExit(err)
|
||||
|
||||
if output != 0:
|
||||
raise SystemExit(output)
|
||||
|
||||
def raise_error_message(self, message: str) -> None:
|
||||
""" A general method to raise an error message and exit. """
|
||||
raise SystemExit(f"\n{self.configs.prog_name}: {self.bred}Error{self.endc}: {message}.\n")
|
||||
|
|
Loading…
Reference in a new issue