Skip to content

Commit 27b1b43

Browse files
authored
Merge branch 'main' into jit-isinstance
2 parents f985963 + a36ce26 commit 27b1b43

File tree

5 files changed

+57
-5
lines changed

5 files changed

+57
-5
lines changed

Doc/library/multiprocessing.rst

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1369,6 +1369,12 @@ object -- see :ref:`multiprocessing-managers`.
13691369
A solitary difference from its close analog exists: its ``acquire`` method's
13701370
first argument is named *block*, as is consistent with :meth:`Lock.acquire`.
13711371

1372+
.. method:: locked()
1373+
1374+
Return a boolean indicating whether this object is locked right now.
1375+
1376+
.. versionadded:: 3.14
1377+
13721378
.. note::
13731379
On macOS, this is indistinguishable from :class:`Semaphore` because
13741380
``sem_getvalue()`` is not implemented on that platform.
@@ -1521,6 +1527,12 @@ object -- see :ref:`multiprocessing-managers`.
15211527
A solitary difference from its close analog exists: its ``acquire`` method's
15221528
first argument is named *block*, as is consistent with :meth:`Lock.acquire`.
15231529

1530+
.. method:: locked()
1531+
1532+
Return a boolean indicating whether this object is locked right now.
1533+
1534+
.. versionadded:: 3.14
1535+
15241536
.. note::
15251537

15261538
On macOS, ``sem_timedwait`` is unsupported, so calling ``acquire()`` with

Include/internal/pycore_opcode_metadata.h

Lines changed: 29 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Lib/test/test_pyrepl/test_pyrepl.py

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1055,11 +1055,15 @@ def test_parse(self):
10551055
self.assertEqual(actual, parsed)
10561056
# The parser should not get tripped up by any
10571057
# other preceding statements
1058-
code = f'import xyz\n{code}'
1059-
with self.subTest(code=code):
1058+
_code = f'import xyz\n{code}'
1059+
parser = ImportParser(_code)
1060+
actual = parser.parse()
1061+
with self.subTest(code=_code):
10601062
self.assertEqual(actual, parsed)
1061-
code = f'import xyz;{code}'
1062-
with self.subTest(code=code):
1063+
_code = f'import xyz;{code}'
1064+
parser = ImportParser(_code)
1065+
actual = parser.parse()
1066+
with self.subTest(code=_code):
10631067
self.assertEqual(actual, parsed)
10641068

10651069
def test_parse_error(self):

Modules/_io/bytesio.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -607,9 +607,9 @@ _io_BytesIO_readinto_impl(bytesio *self, Py_buffer *buffer)
607607
len = 0;
608608
}
609609

610-
memcpy(buffer->buf, PyBytes_AS_STRING(self->buf) + self->pos, len);
611610
assert(self->pos + len < PY_SSIZE_T_MAX);
612611
assert(len >= 0);
612+
memcpy(buffer->buf, PyBytes_AS_STRING(self->buf) + self->pos, len);
613613
self->pos += len;
614614

615615
return PyLong_FromSsize_t(len);

Tools/cases_generator/opcode_metadata_generator.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -157,6 +157,13 @@ def generate_deopt_table(analysis: Analysis, out: CWriter) -> None:
157157
if inst.family is not None:
158158
deopt = inst.family.name
159159
deopts.append((inst.name, deopt))
160+
defined = set(analysis.opmap.values())
161+
for i in range(256):
162+
if i not in defined:
163+
deopts.append((f'{i}', f'{i}'))
164+
165+
assert len(deopts) == 256
166+
assert len(set(x[0] for x in deopts)) == 256
160167
for name, deopt in sorted(deopts):
161168
out.emit(f"[{name}] = {deopt},\n")
162169
out.emit("};\n\n")

0 commit comments

Comments
 (0)