New submission from Richard Neumann:
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.
----------
components: Library (Lib)
messages: 253282
nosy: conqp
priority: normal
severity: normal
status: open
title: Add __bool__() method to subprocess.CompletedProcess
type: enhancement
versions: Python 3.5
_______________________________________
Python tracker <[email protected]>
<http://bugs.python.org/issue25452>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe:
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com