diff options
author | Richard Purdie <richard.purdie@linuxfoundation.org> | 2011-02-21 11:00:34 +0000 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2011-02-21 11:12:15 +0000 |
commit | b42273a909f86776a0398077563d7b3fee92f3cb (patch) | |
tree | 07943ad67e0580797a48b3ac703e2d92753d5f01 /meta | |
parent | 0a8f4f45b66ad5d51dea91a406a17555252dfe42 (diff) | |
download | openembedded-core-b42273a909f86776a0398077563d7b3fee92f3cb.tar.gz openembedded-core-b42273a909f86776a0398077563d7b3fee92f3cb.tar.bz2 openembedded-core-b42273a909f86776a0398077563d7b3fee92f3cb.tar.xz openembedded-core-b42273a909f86776a0398077563d7b3fee92f3cb.zip |
lib/oe/path.py: Add expection class to handle the output argument
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta')
-rw-r--r-- | meta/lib/oe/path.py | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/meta/lib/oe/path.py b/meta/lib/oe/path.py index 74674bfee..48138605d 100644 --- a/meta/lib/oe/path.py +++ b/meta/lib/oe/path.py @@ -80,6 +80,13 @@ def symlink(source, destination, force=False): if e.errno != errno.EEXIST or os.readlink(destination) != source: raise +class CalledProcessError(Exception): + def __init__(self, retcode, cmd, output = None): + self.retcode = retcode + self.cmd = cmd + self.output = output + def __str__(self): + return "Command '%s' returned non-zero exit status %d with output %s" % (self.cmd, self.retcode, self.output) # Not needed when we move to python 2.7 def check_output(*popenargs, **kwargs): @@ -111,6 +118,6 @@ def check_output(*popenargs, **kwargs): cmd = kwargs.get("args") if cmd is None: cmd = popenargs[0] - raise subprocess.CalledProcessError(retcode, cmd, output=output) + raise CalledProcessError(retcode, cmd, output=output) return output |