diff options
| -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 74674bfee8..48138605d0 100644 --- a/meta/lib/oe/path.py +++ b/meta/lib/oe/path.py | |||
| @@ -80,6 +80,13 @@ def symlink(source, destination, force=False): | |||
| 80 | if e.errno != errno.EEXIST or os.readlink(destination) != source: | 80 | if e.errno != errno.EEXIST or os.readlink(destination) != source: |
| 81 | raise | 81 | raise |
| 82 | 82 | ||
| 83 | class CalledProcessError(Exception): | ||
| 84 | def __init__(self, retcode, cmd, output = None): | ||
| 85 | self.retcode = retcode | ||
| 86 | self.cmd = cmd | ||
| 87 | self.output = output | ||
| 88 | def __str__(self): | ||
| 89 | return "Command '%s' returned non-zero exit status %d with output %s" % (self.cmd, self.retcode, self.output) | ||
| 83 | 90 | ||
| 84 | # Not needed when we move to python 2.7 | 91 | # Not needed when we move to python 2.7 |
| 85 | def check_output(*popenargs, **kwargs): | 92 | def check_output(*popenargs, **kwargs): |
| @@ -111,6 +118,6 @@ def check_output(*popenargs, **kwargs): | |||
| 111 | cmd = kwargs.get("args") | 118 | cmd = kwargs.get("args") |
| 112 | if cmd is None: | 119 | if cmd is None: |
| 113 | cmd = popenargs[0] | 120 | cmd = popenargs[0] |
| 114 | raise subprocess.CalledProcessError(retcode, cmd, output=output) | 121 | raise CalledProcessError(retcode, cmd, output=output) |
| 115 | return output | 122 | return output |
| 116 | 123 | ||
