Changeset 3029 for trunk/packages


Ignore:
Timestamp:
Jul 6, 2010, 12:09:08 AM (14 years ago)
Author:
gdb
Message:

Improvements to captureOutput

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/packages/invirt-base/python/invirt/common.py

    r2920 r3029  
    8383        kwargs['stdout'] = subprocess.PIPE
    8484    if 'stderr' not in kwargs:
    85         kwargs['stderr'] = subprocess.STDOUT
     85        kwargs['stderr'] = subprocess.PIPE
    8686    p = subprocess.Popen(popen_args, *args, **kwargs)
    87     out, _ = p.communicate(stdin_str)
     87    out, err = p.communicate(stdin_str)
    8888    if p.returncode:
    89         raise subprocess.CalledProcessError(p.returncode, popen_args, out)
     89        raise subprocess.CalledProcessError(p.returncode, '%s, stdout: %s, stderr: %s' %
     90                                            (popen_args, out, err))
    9091    return out
    9192
Note: See TracChangeset for help on using the changeset viewer.