On 10Feb2017 00:03, eryk sun <eryk...@gmail.com> wrote:
On Thu, Feb 9, 2017 at 10:50 PM, Cameron Simpson <c...@zip.com.au> wrote:
This is why I suggested the check_returncode() method, which examines the
error code.
You must be thinking of the returncode attribute, which isn't a
method. check_returncode() is a method of the CompletedProcess object
that's returned by subprocess.run(), which was added in 3.5. The OP is
using both 3.4 and 3.5, so run() isn't a practical option.
The communicate method mentioned it; I hadn't realised it was new with 3.5,
good point.
The older check_output() function also checks the return code and
raises a subprocess.CalledProcessError if the command fails. For
example: [...]
Cool,
Cameron Simpson <c...@zip.com.au>
--
https://mail.python.org/mailman/listinfo/python-list