summaryrefslogtreecommitdiffstats
path: root/contrib/tools/python3/Lib/multiprocessing
diff options
context:
space:
mode:
authorshadchin <[email protected]>2025-02-16 15:28:01 +0300
committershadchin <[email protected]>2025-02-16 16:03:50 +0300
commita27b6a96fdc5ca444428ddef4823d0486dcdccb9 (patch)
treeadde5c24d9ea37e1634e7972e27e682a820ab941 /contrib/tools/python3/Lib/multiprocessing
parent7a3958c3c6de324baab9dba4bd4eb808c1b839a6 (diff)
Update Python 3 to 3.12.9
commit_hash:c8651982d81e18f18e037fb247cc6ae53c4fa7f1
Diffstat (limited to 'contrib/tools/python3/Lib/multiprocessing')
-rw-r--r--contrib/tools/python3/Lib/multiprocessing/connection.py2
-rw-r--r--contrib/tools/python3/Lib/multiprocessing/resource_tracker.py7
-rw-r--r--contrib/tools/python3/Lib/multiprocessing/synchronize.py2
3 files changed, 6 insertions, 5 deletions
diff --git a/contrib/tools/python3/Lib/multiprocessing/connection.py b/contrib/tools/python3/Lib/multiprocessing/connection.py
index fdbc3bda7db..81ed2ae51d1 100644
--- a/contrib/tools/python3/Lib/multiprocessing/connection.py
+++ b/contrib/tools/python3/Lib/multiprocessing/connection.py
@@ -846,7 +846,7 @@ _MD5_DIGEST_LEN = 16
_LEGACY_LENGTHS = (_MD5ONLY_MESSAGE_LENGTH, _MD5_DIGEST_LEN)
-def _get_digest_name_and_payload(message: bytes) -> (str, bytes):
+def _get_digest_name_and_payload(message): # type: (bytes) -> tuple[str, bytes]
"""Returns a digest name and the payload for a response hash.
If a legacy protocol is detected based on the message length
diff --git a/contrib/tools/python3/Lib/multiprocessing/resource_tracker.py b/contrib/tools/python3/Lib/multiprocessing/resource_tracker.py
index 79e96ecf324..23fea295c35 100644
--- a/contrib/tools/python3/Lib/multiprocessing/resource_tracker.py
+++ b/contrib/tools/python3/Lib/multiprocessing/resource_tracker.py
@@ -142,13 +142,14 @@ class ResourceTracker(object):
# that can make the child die before it registers signal handlers
# for SIGINT and SIGTERM. The mask is unregistered after spawning
# the child.
+ prev_sigmask = None
try:
if _HAVE_SIGMASK:
- signal.pthread_sigmask(signal.SIG_BLOCK, _IGNORED_SIGNALS)
+ prev_sigmask = signal.pthread_sigmask(signal.SIG_BLOCK, _IGNORED_SIGNALS)
pid = util.spawnv_passfds(exe, args, fds_to_pass)
finally:
- if _HAVE_SIGMASK:
- signal.pthread_sigmask(signal.SIG_UNBLOCK, _IGNORED_SIGNALS)
+ if prev_sigmask is not None:
+ signal.pthread_sigmask(signal.SIG_SETMASK, prev_sigmask)
except:
os.close(w)
raise
diff --git a/contrib/tools/python3/Lib/multiprocessing/synchronize.py b/contrib/tools/python3/Lib/multiprocessing/synchronize.py
index 0f682b9a094..870c91349b9 100644
--- a/contrib/tools/python3/Lib/multiprocessing/synchronize.py
+++ b/contrib/tools/python3/Lib/multiprocessing/synchronize.py
@@ -360,7 +360,7 @@ class Event(object):
return True
return False
- def __repr__(self) -> str:
+ def __repr__(self):
set_status = 'set' if self.is_set() else 'unset'
return f"<{type(self).__qualname__} at {id(self):#x} {set_status}>"
#