[3.12] gh-118761: Revert "Improve import time of `subprocess` (GH-129427)" (GH-130201) by miss-islington · Pull Request #130205 · python/cpython
def __str__(self): if self.returncode and self.returncode < 0: # Lazy import to improve module import time import signal try: return "Command '%s' died with %r." % ( self.cmd, signal.Signals(-self.returncode))
# Lazy import to improve module import time import signal if sig == signal.SIGTERM: self.terminate() elif sig == signal.CTRL_C_EVENT:
kwargs = {} if restore_signals: # Lazy import to improve module import time import signal
# See _Py_RestoreSignals() in Python/pylifecycle.c sigset = [] for signame in ('SIGPIPE', 'SIGXFZ', 'SIGXFSZ'):
def kill(self): """Kill the process with SIGKILL """ # Lazy import to improve module import time import signal self.send_signal(signal.SIGKILL)