Skip to content

Commit 31b611e

Browse files
authored
Merge branch 'main' into missingBreak
2 parents e2f0e8e + b378d99 commit 31b611e

35 files changed

+944
-783
lines changed

.github/dependabot.yml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,3 +12,10 @@ updates:
1212
update-types:
1313
- "version-update:semver-minor"
1414
- "version-update:semver-patch"
15+
- package-ecosystem: "pip"
16+
directory: "/Tools/clinic/"
17+
schedule:
18+
interval: "monthly"
19+
labels:
20+
- "skip issue"
21+
- "skip news"

.github/workflows/mypy.yml

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
# Workflow to run mypy on select parts of the CPython repo
2+
name: mypy
3+
4+
on:
5+
push:
6+
branches:
7+
- main
8+
pull_request:
9+
paths:
10+
- "Tools/clinic/**"
11+
- ".github/workflows/mypy.yml"
12+
workflow_dispatch:
13+
14+
permissions:
15+
contents: read
16+
17+
env:
18+
PIP_DISABLE_PIP_VERSION_CHECK: 1
19+
FORCE_COLOR: 1
20+
TERM: xterm-256color # needed for FORCE_COLOR to work on mypy on Ubuntu, see https://github.com/python/mypy/issues/13817
21+
22+
concurrency:
23+
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
24+
cancel-in-progress: true
25+
26+
jobs:
27+
mypy:
28+
name: Run mypy on Tools/clinic/
29+
runs-on: ubuntu-latest
30+
timeout-minutes: 10
31+
steps:
32+
- uses: actions/checkout@v3
33+
- uses: actions/setup-python@v4
34+
with:
35+
python-version: "3.x"
36+
cache: pip
37+
cache-dependency-path: Tools/clinic/requirements-dev.txt
38+
- run: pip install -r Tools/clinic/requirements-dev.txt
39+
- run: mypy --config-file Tools/clinic/mypy.ini

Doc/library/atexit.rst

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,9 @@ at interpreter termination time they will be run in the order ``C``, ``B``,
2020
program is killed by a signal not handled by Python, when a Python fatal
2121
internal error is detected, or when :func:`os._exit` is called.
2222

23+
**Note:** The effect of registering or unregistering functions from within
24+
a cleanup function is undefined.
25+
2326
.. versionchanged:: 3.7
2427
When used with C-API subinterpreters, registered functions
2528
are local to the interpreter they were registered in.

Doc/whatsnew/3.12.rst

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1204,6 +1204,8 @@ Build Changes
12041204

12051205
(Contributed by Zhang Na in :gh:`90656`.)
12061206

1207+
* ``PYTHON_FOR_REGEN`` now require Python 3.10 or newer.
1208+
12071209

12081210
C API Changes
12091211
=============

Lib/test/test_io.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4242,6 +4242,7 @@ def test_warn_on_dealloc_fd(self):
42424242

42434243
def test_pickling(self):
42444244
# Pickling file objects is forbidden
4245+
msg = "cannot pickle"
42454246
for kwargs in [
42464247
{"mode": "w"},
42474248
{"mode": "wb"},
@@ -4256,8 +4257,10 @@ def test_pickling(self):
42564257
if "b" not in kwargs["mode"]:
42574258
kwargs["encoding"] = "utf-8"
42584259
for protocol in range(pickle.HIGHEST_PROTOCOL + 1):
4259-
with self.open(os_helper.TESTFN, **kwargs) as f:
4260-
self.assertRaises(TypeError, pickle.dumps, f, protocol)
4260+
with self.subTest(protocol=protocol, kwargs=kwargs):
4261+
with self.open(os_helper.TESTFN, **kwargs) as f:
4262+
with self.assertRaisesRegex(TypeError, msg):
4263+
pickle.dumps(f, protocol)
42614264

42624265
@unittest.skipIf(
42634266
support.is_emscripten, "fstat() of a pipe fd is not supported"

Lib/test/test_tkinter/test_geometry_managers.py

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -108,8 +108,8 @@ def test_pack_configure_in(self):
108108
a.pack_configure(in_=c)
109109
self.assertEqual(pack.pack_slaves(), [b, c, d])
110110
self.assertEqual(c.pack_slaves(), [a])
111-
with self.assertRaisesRegex(TclError,
112-
'can\'t pack %s inside itself' % (a,)):
111+
with self.assertRaisesRegex(
112+
TclError, """can't pack "?%s"? inside itself""" % (a,)):
113113
a.pack_configure(in_=a)
114114
with self.assertRaisesRegex(TclError, 'bad window path name ".foo"'):
115115
a.pack_configure(in_='.foo')
@@ -292,8 +292,10 @@ def create2(self):
292292
def test_place_configure_in(self):
293293
t, f, f2 = self.create2()
294294
self.assertEqual(f2.winfo_manager(), '')
295-
with self.assertRaisesRegex(TclError, "can't place %s relative to "
296-
"itself" % re.escape(str(f2))):
295+
with self.assertRaisesRegex(
296+
TclError,
297+
"""can't place "?%s"? relative to itself"""
298+
% re.escape(str(f2))):
297299
f2.place_configure(in_=f2)
298300
self.assertEqual(f2.winfo_manager(), '')
299301
with self.assertRaisesRegex(TclError, 'bad window path name'):

0 commit comments

Comments
 (0)