Skip to content

Commit 8eb3cbd

Browse files
authored
Merge branch 'main' into union_getitem
2 parents 26c9a32 + 6430c63 commit 8eb3cbd

34 files changed

Lines changed: 565 additions & 260 deletions

.github/CODEOWNERS

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ Modules/Setup* @erlend-aasland
3030
Objects/set* @rhettinger
3131
Objects/dict* @methane @markshannon
3232
Objects/typevarobject.c @JelleZijlstra
33+
Objects/unionobject.c @JelleZijlstra
3334
Objects/type* @markshannon
3435
Objects/codeobject.c @markshannon
3536
Objects/frameobject.c @markshannon

.github/zizmor.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,3 +4,7 @@ rules:
44
dangerous-triggers:
55
ignore:
66
- documentation-links.yml
7+
unpinned-uses:
8+
config:
9+
policies:
10+
"*": ref-pin

.pre-commit-config.yaml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
repos:
22
- repo: https://github.com/astral-sh/ruff-pre-commit
3-
rev: v0.11.4
3+
rev: v0.11.6
44
hooks:
55
- id: ruff
66
name: Run Ruff (lint) on Doc/
@@ -24,7 +24,7 @@ repos:
2424
files: ^Doc/
2525

2626
- repo: https://github.com/psf/black-pre-commit-mirror
27-
rev: 24.10.0
27+
rev: 25.1.0
2828
hooks:
2929
- id: black
3030
name: Run Black on Tools/build/check_warnings.py
@@ -49,7 +49,7 @@ repos:
4949
types_or: [c, inc, python, rst]
5050

5151
- repo: https://github.com/python-jsonschema/check-jsonschema
52-
rev: 0.31.0
52+
rev: 0.33.0
5353
hooks:
5454
- id: check-dependabot
5555
- id: check-github-workflows
@@ -61,7 +61,7 @@ repos:
6161
- id: actionlint
6262

6363
- repo: https://github.com/woodruffw/zizmor-pre-commit
64-
rev: v1.1.1
64+
rev: v1.6.0
6565
hooks:
6666
- id: zizmor
6767

Doc/library/multiprocessing.rst

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -670,6 +670,25 @@ The :mod:`multiprocessing` package mostly replicates the API of the
670670

671671
.. versionadded:: 3.3
672672

673+
.. method:: interrupt()
674+
675+
Terminate the process. Works on POSIX using the :py:const:`~signal.SIGINT` signal.
676+
Behavior on Windows is undefined.
677+
678+
By default, this terminates the child process by raising :exc:`KeyboardInterrupt`.
679+
This behavior can be altered by setting the respective signal handler in the child
680+
process :func:`signal.signal` for :py:const:`~signal.SIGINT`.
681+
682+
Note: if the child process catches and discards :exc:`KeyboardInterrupt`, the
683+
process will not be terminated.
684+
685+
Note: the default behavior will also set :attr:`exitcode` to ``1`` as if an
686+
uncaught exception was raised in the child process. To have a different
687+
:attr:`exitcode` you may simply catch :exc:`KeyboardInterrupt` and call
688+
``exit(your_code)``.
689+
690+
.. versionadded:: next
691+
673692
.. method:: terminate()
674693

675694
Terminate the process. On POSIX this is done using the :py:const:`~signal.SIGTERM` signal;

Doc/whatsnew/3.14.rst

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -972,6 +972,10 @@ multiprocessing
972972
The :func:`set` in :func:`multiprocessing.Manager` method is now available.
973973
(Contributed by Mingyu Park in :gh:`129949`.)
974974

975+
* Add :func:`multiprocessing.Process.interrupt` which terminates the child
976+
process by sending :py:const:`~signal.SIGINT`. This enables "finally" clauses
977+
and printing stack trace for the terminated process.
978+
(Contributed by Artem Pulkin in :gh:`131913`.)
975979

976980
operator
977981
--------

Include/internal/pycore_opcode_metadata.h

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)