Merge remote-tracking branch 'upstream/master' into fix_issue_702

main
Yannis Spiliopoulos 9 years ago
commit 1a9b36b19e

@ -60,12 +60,16 @@ _signames = dict((getattr(signal, signame), signame)
def signal_name(signum): def signal_name(signum):
# Hackety-hack-hack: is there really no better way to reverse lookup the
# signal name? If you read this and know a way: please provide a patch :)
try: try:
if sys.version_info[:2] >= (3, 5):
return signal.Signals(signum).name
else:
return _signames[signum] return _signames[signum]
except KeyError: except KeyError:
return 'SIG_UNKNOWN' return 'SIG_UNKNOWN'
except ValueError:
return 'SIG_UNKNOWN'
WorkerStatus = enum( WorkerStatus = enum(

Loading…
Cancel
Save