MCPcopy Create free account
hub / github.com/RT-Thread/env-windows / CompletedProcess

Class CompletedProcess

tools/python-3.11.9-amd64/Lib/subprocess.py:470–503  ·  view source on GitHub ↗

A process that has finished running. This is returned by run(). Attributes: args: The list or str args passed to run(). returncode: The exit code of the process, negative for signals. stdout: The standard output (None if not captured). stderr: The standard e

Source from the content-addressed store, hash-verified

468
469
470class CompletedProcess(object):
471 """A process that has finished running.
472
473 This is returned by run().
474
475 Attributes:
476 args: The list or str args passed to run().
477 returncode: The exit code of the process, negative for signals.
478 stdout: The standard output (None if not captured).
479 stderr: The standard error (None if not captured).
480 """
481 def __init__(self, args, returncode, stdout=None, stderr=None):
482 self.args = args
483 self.returncode = returncode
484 self.stdout = stdout
485 self.stderr = stderr
486
487 def __repr__(self):
488 args = ['args={!r}'.format(self.args),
489 'returncode={!r}'.format(self.returncode)]
490 if self.stdout is not None:
491 args.append('stdout={!r}'.format(self.stdout))
492 if self.stderr is not None:
493 args.append('stderr={!r}'.format(self.stderr))
494 return "{}({})".format(type(self).__name__, ', '.join(args))
495
496 __class_getitem__ = classmethod(types.GenericAlias)
497
498
499 def check_returncode(self):
500 """Raise CalledProcessError if the exit code is non-zero."""
501 if self.returncode:
502 raise CalledProcessError(self.returncode, self.args, self.stdout,
503 self.stderr)
504
505
506def run(*popenargs,

Callers 1

runFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected