Skip to content

Commit

Permalink
fixup! flux-jobs: support inactive_reason output field
Browse files Browse the repository at this point in the history
  • Loading branch information
chu11 committed May 11, 2023
1 parent 21bb232 commit 99fcdbe
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 6 deletions.
1 change: 1 addition & 0 deletions src/bindings/python/flux/compat36.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@

import signal


# strsignal() is only available on Python 3.8 and up
def strsignal(signum):
if signum == signal.SIGHUP:
Expand Down
9 changes: 3 additions & 6 deletions src/bindings/python/flux/job/info.py
Original file line number Diff line number Diff line change
Expand Up @@ -572,12 +572,9 @@ def inactive_reason(self):
return f'Exception: type={self.exception.type}{note or ""}'
elif self.returncode > 128:
signum = self.returncode - 128
# strsignal() is only available in
# Python 3.8 and up. flux-core's minimum is 3.6.
try:
from signal import strsignal
except ImportError:
from flux.compat36 import strsignal
# strsignal() is only available in Python 3.8 and up.
# flux-core's minimum is 3.6. Use compat library
from flux.compat36 import strsignal
try:
sigdesc = strsignal(signum)
except ValueError:
Expand Down

0 comments on commit 99fcdbe

Please sign in to comment.