diff options
author | shadchin <shadchin@yandex-team.com> | 2025-06-13 00:05:26 +0300 |
---|---|---|
committer | shadchin <shadchin@yandex-team.com> | 2025-06-13 00:35:30 +0300 |
commit | 796b9088366b10b4cd42885101fc20c0b5709b07 (patch) | |
tree | f287eacb0b95ffd7cabf95b16cafb4788645dc38 /contrib/tools/python3/Lib/subprocess.py | |
parent | c72bca862651e507d2ff4980ef7f4ff7267a7227 (diff) | |
download | ydb-796b9088366b10b4cd42885101fc20c0b5709b07.tar.gz |
Update Python 3 to 3.12.10
commit_hash:dd2398e159fe1d72ea6b12da52fccc933a41a785
Diffstat (limited to 'contrib/tools/python3/Lib/subprocess.py')
-rw-r--r-- | contrib/tools/python3/Lib/subprocess.py | 16 |
1 files changed, 2 insertions, 14 deletions
diff --git a/contrib/tools/python3/Lib/subprocess.py b/contrib/tools/python3/Lib/subprocess.py index 3ec39ca3e61..881a9ce800a 100644 --- a/contrib/tools/python3/Lib/subprocess.py +++ b/contrib/tools/python3/Lib/subprocess.py @@ -43,8 +43,10 @@ getstatusoutput(...): Runs a command in the shell, waits for it to complete, import builtins import errno import io +import locale import os import time +import signal import sys import threading import warnings @@ -136,8 +138,6 @@ class CalledProcessError(SubprocessError): 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)) @@ -375,8 +375,6 @@ def _text_encoding(): if sys.flags.utf8_mode: return "utf-8" else: - # Lazy import to improve module import time - import locale return locale.getencoding() @@ -1657,9 +1655,6 @@ class Popen: # Don't signal a process that we know has already died. if self.returncode is not None: return - - # Lazy import to improve module import time - import signal if sig == signal.SIGTERM: self.terminate() elif sig == signal.CTRL_C_EVENT: @@ -1764,9 +1759,6 @@ class Popen: 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'): @@ -2216,13 +2208,9 @@ class Popen: def terminate(self): """Terminate the process with SIGTERM """ - # Lazy import to improve module import time - import signal self.send_signal(signal.SIGTERM) def kill(self): """Kill the process with SIGKILL """ - # Lazy import to improve module import time - import signal self.send_signal(signal.SIGKILL) |