Skip to content

Commit c4cd138

Browse files
authored
Merge branch '3.13' into backport-97b2cea-3.13
2 parents 120c2bc + 4cba0e6 commit c4cd138

File tree

17 files changed

+71
-19
lines changed

17 files changed

+71
-19
lines changed

.github/workflows/reusable-macos.yml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,10 @@ jobs:
3737
path: config.cache
3838
key: ${{ github.job }}-${{ inputs.os }}-${{ env.IMAGE_VERSION }}-${{ inputs.config_hash }}
3939
- name: Install Homebrew dependencies
40-
run: brew install pkg-config openssl@3.0 xz gdbm tcl-tk
40+
run: |
41+
brew install pkg-config openssl@3.0 xz gdbm tcl-tk@8
42+
# Because alternate versions are not symlinked into place by default:
43+
brew link tcl-tk@8
4144
- name: Configure CPython
4245
run: |
4346
GDBM_CFLAGS="-I$(brew --prefix gdbm)/include" \

Doc/c-api/object.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ Object Protocol
8585
instead of the :func:`repr`.
8686
8787
88-
.. c:function:: int PyObject_HasAttrWithError(PyObject *o, const char *attr_name)
88+
.. c:function:: int PyObject_HasAttrWithError(PyObject *o, PyObject *attr_name)
8989
9090
Returns ``1`` if *o* has the attribute *attr_name*, and ``0`` otherwise.
9191
This is equivalent to the Python expression ``hasattr(o, attr_name)``.

Doc/library/asyncio-sync.rst

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -259,16 +259,16 @@ Condition
259259

260260
Note that a task *may* return from this call spuriously,
261261
which is why the caller should always re-check the state
262-
and be prepared to :meth:`wait` again. For this reason, you may
263-
prefer to use :meth:`wait_for` instead.
262+
and be prepared to :meth:`~Condition.wait` again. For this reason, you may
263+
prefer to use :meth:`~Condition.wait_for` instead.
264264

265265
.. coroutinemethod:: wait_for(predicate)
266266

267267
Wait until a predicate becomes *true*.
268268

269269
The predicate must be a callable which result will be
270270
interpreted as a boolean value. The method will repeatedly
271-
:meth:`wait` until the predicate evaluates to *true*. The final value is the
271+
:meth:`~Condition.wait` until the predicate evaluates to *true*. The final value is the
272272
return value.
273273

274274

@@ -434,7 +434,7 @@ Barrier
434434
.. coroutinemethod:: abort()
435435

436436
Put the barrier into a broken state. This causes any active or future
437-
calls to :meth:`wait` to fail with the :class:`BrokenBarrierError`.
437+
calls to :meth:`~Barrier.wait` to fail with the :class:`BrokenBarrierError`.
438438
Use this for example if one of the tasks needs to abort, to avoid infinite
439439
waiting tasks.
440440

Doc/library/contextlib.rst

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -151,9 +151,9 @@ Functions and classes provided:
151151
created by :func:`asynccontextmanager` to meet the requirement that context
152152
managers support multiple invocations in order to be used as decorators.
153153

154-
.. versionchanged:: 3.10
155-
Async context managers created with :func:`asynccontextmanager` can
156-
be used as decorators.
154+
.. versionchanged:: 3.10
155+
Async context managers created with :func:`asynccontextmanager` can
156+
be used as decorators.
157157

158158

159159
.. function:: closing(thing)

Doc/library/token.rst

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,13 @@ the :mod:`tokenize` module.
7979
``type_comments=True``.
8080

8181

82+
.. data:: EXACT_TOKEN_TYPES
83+
84+
A dictionary mapping the string representation of a token to its numeric code.
85+
86+
.. versionadded:: 3.8
87+
88+
8289
.. versionchanged:: 3.5
8390
Added :data:`!AWAIT` and :data:`!ASYNC` tokens.
8491

Lib/test/test_asyncio/test_eager_task_factory.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -220,10 +220,14 @@ async def fail():
220220
await asyncio.sleep(0)
221221
raise ValueError("no good")
222222

223+
async def blocked():
224+
fut = asyncio.Future()
225+
await fut
226+
223227
async def run():
224228
winner, index, excs = await asyncio.staggered.staggered_race(
225229
[
226-
lambda: asyncio.sleep(2, result="sleep2"),
230+
lambda: blocked(),
227231
lambda: asyncio.sleep(1, result="sleep1"),
228232
lambda: fail()
229233
],

Lib/test/test_free_threading/test_type.py

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -125,6 +125,21 @@ def work():
125125
for thread in threads:
126126
thread.join()
127127

128+
def test_object_class_change(self):
129+
class Base:
130+
def __init__(self):
131+
self.attr = 123
132+
class ClassA(Base):
133+
pass
134+
class ClassB(Base):
135+
pass
136+
137+
obj = ClassA()
138+
# keep reference to __dict__
139+
d = obj.__dict__
140+
obj.__class__ = ClassB
141+
142+
128143
def run_one(self, writer_func, reader_func):
129144
writer = Thread(target=writer_func)
130145
readers = []

Lib/test/test_import/__init__.py

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1152,6 +1152,19 @@ def test_script_shadowing_stdlib_sys_path_modification(self):
11521152
stdout, stderr = popen.communicate()
11531153
self.assertRegex(stdout, expected_error)
11541154

1155+
def test_create_dynamic_null(self):
1156+
with self.assertRaisesRegex(ValueError, 'embedded null character'):
1157+
class Spec:
1158+
name = "a\x00b"
1159+
origin = "abc"
1160+
_imp.create_dynamic(Spec())
1161+
1162+
with self.assertRaisesRegex(ValueError, 'embedded null character'):
1163+
class Spec2:
1164+
name = "abc"
1165+
origin = "a\x00b"
1166+
_imp.create_dynamic(Spec2())
1167+
11551168

11561169
@skip_if_dont_write_bytecode
11571170
class FilePermissionTests(unittest.TestCase):

Lib/test/test_os.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4124,12 +4124,13 @@ def test_eventfd_select(self):
41244124
os.eventfd_read(fd)
41254125

41264126
@unittest.skipUnless(hasattr(os, 'timerfd_create'), 'requires os.timerfd_create')
4127+
@unittest.skipIf(sys.platform == "android", "gh-124873: Test is flaky on Android")
41274128
@support.requires_linux_version(2, 6, 30)
41284129
class TimerfdTests(unittest.TestCase):
41294130
# 1 ms accuracy is reliably achievable on every platform except Android
4130-
# emulators, where we allow 100 ms (gh-124873).
4131+
# emulators, where we allow 10 ms (gh-108277).
41314132
if sys.platform == "android" and platform.android_ver().is_emulator:
4132-
CLOCK_RES_PLACES = 1
4133+
CLOCK_RES_PLACES = 2
41334134
else:
41344135
CLOCK_RES_PLACES = 3
41354136

Lib/token.py

Lines changed: 2 additions & 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)