This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author conqp
Recipients conqp
Date 2015-10-21.10:50:58
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1445424658.54.0.134413313052.issue25452@psf.upfronthosting.co.za>
In-reply-to
Content
The class subprocess.CompletedProcess is currently lacking a __bool__() method.

It might be a practical feature to have the possibility to evaluate a CompletedProcess instance in an if/else block without the necessity to handle the exception raised by CompletedProcess.check_returncode().

Hence, I suggest adding the method

def __bool__(self):
    return self.returncode == 0

to the class.
History
Date User Action Args
2015-10-21 10:50:58conqpsetrecipients: + conqp
2015-10-21 10:50:58conqpsetmessageid: <1445424658.54.0.134413313052.issue25452@psf.upfronthosting.co.za>
2015-10-21 10:50:58conqplinkissue25452 messages
2015-10-21 10:50:58conqpcreate