Skip to content

Commit 7e3b3dc

Browse files
committed
Merge branch 'master' into numden-props/122450
2 parents 762e14c + 3a64844 commit 7e3b3dc

File tree

7 files changed

+25
-10
lines changed

7 files changed

+25
-10
lines changed

Doc/c-api/memory.rst

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -672,6 +672,10 @@ This allocator is disabled if Python is configured with the
672672
:option:`--without-pymalloc` option. It can also be disabled at runtime using
673673
the :envvar:`PYTHONMALLOC` environment variable (ex: ``PYTHONMALLOC=malloc``).
674674
675+
Typically, it makes sense to disable the pymalloc allocator when building
676+
Python with AddressSanitizer (:option:`--with-address-sanitizer`) which helps
677+
uncover low level bugs within the C code.
678+
675679
Customize pymalloc Arena Allocator
676680
----------------------------------
677681

Doc/library/multiprocessing.rst

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -936,8 +936,13 @@ For an example of the usage of queues for interprocess communication see
936936

937937
.. method:: close()
938938

939-
Indicate that no more data will be put on this queue by the current
940-
process. The background thread will quit once it has flushed all buffered
939+
Close the queue: release internal resources.
940+
941+
A queue must not be used anymore after it is closed. For example,
942+
:meth:`~Queue.get`, :meth:`~Queue.put` and :meth:`~Queue.empty`
943+
methods must no longer be called.
944+
945+
The background thread will quit once it has flushed all buffered
941946
data to the pipe. This is called automatically when the queue is garbage
942947
collected.
943948

Doc/using/configure.rst

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -802,6 +802,9 @@ Debug options
802802
.. option:: --with-address-sanitizer
803803

804804
Enable AddressSanitizer memory error detector, ``asan`` (default is no).
805+
To improve ASan detection capabilities you may also want to combine this
806+
with :option:`--without-pymalloc` to disable the specialized small-object
807+
allocator whose allocations are not tracked by ASan.
805808

806809
.. versionadded:: 3.6
807810

Lib/_pyrepl/utils.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -241,14 +241,14 @@ def is_soft_keyword_used(*tokens: TI | None) -> bool:
241241
return s in keyword_first_sets_match
242242
return True
243243
case (
244-
None | TI(T.NEWLINE) | TI(T.INDENT) | TI(string=":"),
244+
None | TI(T.NEWLINE) | TI(T.INDENT) | TI(T.DEDENT) | TI(string=":"),
245245
TI(string="case"),
246246
TI(T.NUMBER | T.STRING | T.FSTRING_START | T.TSTRING_START)
247247
| TI(T.OP, string="(" | "*" | "-" | "[" | "{")
248248
):
249249
return True
250250
case (
251-
None | TI(T.NEWLINE) | TI(T.INDENT) | TI(string=":"),
251+
None | TI(T.NEWLINE) | TI(T.INDENT) | TI(T.DEDENT) | TI(string=":"),
252252
TI(string="case"),
253253
TI(T.NAME, string=s)
254254
):

Lib/enum.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1991,7 +1991,7 @@ def __call__(self, enumeration):
19911991
if 2**i not in values:
19921992
missing.append(2**i)
19931993
elif enum_type == 'enum':
1994-
# check for powers of one
1994+
# check for missing consecutive integers
19951995
for i in range(low+1, high):
19961996
if i not in values:
19971997
missing.append(i)

Lib/test/test_pyrepl/test_reader.py

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -375,7 +375,8 @@ def funct(case: str = sys.platform) -> None:
375375
)
376376
match case:
377377
case "emscripten": print("on the web")
378-
case "ios" | "android": print("on the phone")
378+
case "ios" | "android":
379+
print("on the phone")
379380
case _: print('arms around', match.group(1))
380381
"""
381382
)
@@ -393,7 +394,8 @@ def funct(case: str = sys.platform) -> None:
393394
{o}){z}
394395
{K}match{z} case{o}:{z}
395396
{K}case{z} {s}"emscripten"{z}{o}:{z} {b}print{z}{o}({z}{s}"on the web"{z}{o}){z}
396-
{K}case{z} {s}"ios"{z} {o}|{z} {s}"android"{z}{o}:{z} {b}print{z}{o}({z}{s}"on the phone"{z}{o}){z}
397+
{K}case{z} {s}"ios"{z} {o}|{z} {s}"android"{z}{o}:{z}
398+
{b}print{z}{o}({z}{s}"on the phone"{z}{o}){z}
397399
{K}case{z} {K}_{z}{o}:{z} {b}print{z}{o}({z}{s}'arms around'{z}{o},{z} match{o}.{z}group{o}({z}{n}1{z}{o}){z}{o}){z}
398400
"""
399401
)
@@ -402,14 +404,14 @@ def funct(case: str = sys.platform) -> None:
402404
reader, _ = handle_all_events(events)
403405
self.assert_screen_equal(reader, code, clean=True)
404406
self.assert_screen_equal(reader, expected_sync)
405-
self.assertEqual(reader.pos, 2**7 + 2**8)
406-
self.assertEqual(reader.cxy, (0, 14))
407+
self.assertEqual(reader.pos, 396)
408+
self.assertEqual(reader.cxy, (0, 15))
407409

408410
async_msg = "{k}async{z} ".format(**colors)
409411
expected_async = expected.format(a=async_msg, **colors)
410412
more_events = itertools.chain(
411413
code_to_events(code),
412-
[Event(evt="key", data="up", raw=bytearray(b"\x1bOA"))] * 13,
414+
[Event(evt="key", data="up", raw=bytearray(b"\x1bOA"))] * 14,
413415
code_to_events("async "),
414416
)
415417
reader, _ = handle_all_events(more_events)
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Fix PyREPL syntax highlightning on match cases after multi-line case. Contributed by Olga Matoula.

0 commit comments

Comments
 (0)