forked from extern/httpie-cli
Make ExitStatus
subclass IntEnum
to allow direct int
comparisons
This commit is contained in:
parent
f031b8cc8b
commit
d9b3a16fa6
@ -68,7 +68,7 @@ def main(
|
||||
raise
|
||||
exit_status = ExitStatus.ERROR_CTRL_C
|
||||
except SystemExit as e:
|
||||
if e.code != ExitStatus.SUCCESS.value:
|
||||
if e.code != ExitStatus.SUCCESS:
|
||||
env.stderr.write('\n')
|
||||
if include_traceback:
|
||||
raise
|
||||
@ -86,7 +86,7 @@ def main(
|
||||
raise
|
||||
exit_status = ExitStatus.ERROR_CTRL_C
|
||||
except SystemExit as e:
|
||||
if e.code != ExitStatus.SUCCESS.value:
|
||||
if e.code != ExitStatus.SUCCESS:
|
||||
env.stderr.write('\n')
|
||||
if include_traceback:
|
||||
raise
|
||||
|
@ -1,7 +1,7 @@
|
||||
from enum import Enum
|
||||
from enum import IntEnum
|
||||
|
||||
|
||||
class ExitStatus(Enum):
|
||||
class ExitStatus(IntEnum):
|
||||
"""Program exit code constants."""
|
||||
SUCCESS = 0
|
||||
ERROR = 1
|
||||
|
Loading…
Reference in New Issue
Block a user