Commit 1ba99601 authored by Johannes Bechberger's avatar Johannes Bechberger
Browse files

Improve posix error code message

parent 7958822e
......@@ -4,6 +4,7 @@
Convenience function
Alternative to subprocess and os.system
import os
import shlex
import subprocess
has_resource_module = True
......@@ -113,7 +114,7 @@ class _Execute(object):
self.returncode = 128 - self.returncode
if self.returncode in _EXIT_CODES:
_LOG.debug("returncode %d recognized as '%s'" % (self.returncode, _EXIT_CODES[self.returncode]))
raise SigKill(self.returncode, _EXIT_CODES[self.returncode])
raise SigKill(-self.returncode, _EXIT_CODES[self.returncode] + ": " + os.strerror(-self.returncode))
return (self.out, self.err, self.returncode)
def execute(cmd, env=None, timeout=0, rlimit=None, propagate_sigint=True):
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment