8000 Merge branch 'main' into fix-issue-114763 · python/cpython@023d65d · GitHub
[go: up one dir, main page]

Skip to content

Commit 023d65d

Browse files
authored
Merge branch 'main' into fix-issue-114763
2 parents 6322dd6 + 462a2fc commit 023d65d

28 files changed

+722
-305
lines changed

Doc/howto/gdb_helpers.rst

Lines changed: 449 additions & 0 deletions
Large diffs are not rendered by default.

Doc/howto/index.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ Currently, the HOWTOs are:
1616
cporting.rst
1717
curses.rst
1818
descriptor.rst
19+
gdb_helpers.rst
1920
enum.rst
2021
functional.rst
2122
logging.rst

Doc/library/pyexpat.rst

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -214,7 +214,8 @@ XMLParser Objects
214214
:meth:`CharacterDataHandler` callback whenever possible. This can improve
215215
performance substantially since Expat normally breaks character data into chunks
216216
at every line ending. This attribute is false by default, and may be changed at
217-
any time.
217+
any time. Note that when it is false, data that does not contain newlines
218+
may be chunked too.
218219

219220

220221
.. attribute:: xmlparser.buffer_used
@@ -372,7 +373,10 @@ otherwise stated.
372373
marked content, and ignorable whitespace. Applications which must distinguish
373374
these cases can use the :attr:`StartCdataSectionHandler`,
374375
:attr:`EndCdataSectionHandler`, and :attr:`ElementDeclHandler` callbacks to
375-
collect the required information.
376+
collect the required information. Note that the character data may be
377+
chunked even if it is short and so you may receive more than one call to
378+
:meth:`CharacterDataHandler`. Set the :attr:`buffer_text` instance attribute
379+
to ``True`` to avoid that.
376380

377381

378382
.. method:: xmlparser.UnparsedEntityDeclHandler(entityName, base, systemId, publicId, notationName)

Lib/idlelib/editor.py

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1044,7 +1044,9 @@ def open_recent_file(fn_closure=file_name):
10441044
def saved_change_hook(self):
10451045
short = self.short_title()
10461046
long = self.long_title()
1047-
if short and long:
1047+
if short and long and not macosx.isCocoaTk():
1048+
# Don't use both values on macOS because
1049+
# that doesn't match platform conventions.
10481050
title = short + " - " + long + _py_version
10491051
elif short:
10501052
title = short
@@ -1059,6 +1061,13 @@ def saved_change_hook(self):
10591061
self.top.wm_title(title)
10601062
self.top.wm_iconname(icon)
10611063

1064+
if macosx.isCocoaTk():
1065+
# Add a proxy icon to the window title
1066+
self.top.wm_attributes("-titlepath", long)
1067+
1068+
# Maintain the modification status for the window
1069+
self.top.wm_attributes("-modified", not self.get_saved())
1070+
10621071
def get_saved(self):
10631072
return self.undo.get_saved()
10641073

Lib/test/test_capi/test_opt.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
import textwrap
55
import unittest
66
import gc
7+
import os
78

89
import _testinternalcapi
910

@@ -568,6 +569,8 @@ def testfunc(n):
568569
count = ops.count("_GUARD_IS_TRUE_POP") + ops.count("_GUARD_IS_FALSE_POP")
569570
self.assertLessEqual(count, 2)
570571

572+
573+
@unittest.skipIf(os.getenv("PYTHONUOPSOPTIMIZE", default=0) == 0, "Needs uop optimizer to run.")
571574
class TestUopsOptimization(unittest.TestCase):
572575

573576
def _run_with_optimizer(self, testfunc, arg):

Lib/test/test_monitoring.py

Lines changed: 14 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,9 @@ def g1():
3535
TEST_TOOL2 = 3
3636
TEST_TOOL3 = 4
3737

38+
def nth_line(func, offset):
39+
return func.__code__.co_firstlineno + offset
40+
3841
class MonitoringBasicTest(unittest.TestCase):
3942

4043
def test_has_objects(self):
@@ -529,8 +532,8 @@ def test_lines_single(self):
529532
f1()
530533
sys.monitoring.set_events(TEST_TOOL, 0)
531534
sys.monitoring.register_callback(TEST_TOOL, E.LINE, None)
532-
start = LineMonitoringTest.test_lines_single.__code__.co_firstlineno
533-
self.assertEqual(events, [start+7, 16, start+8])
535+
start = nth_line(LineMonitoringTest.test_lines_single, 0)
536+
self.assertEqual(events, [start+7, nth_line(f1, 1), start+8])
534537
finally:
535538
sys.monitoring.set_events(TEST_TOOL, 0)
536539
sys.monitoring.register_callback(TEST_TOOL, E.LINE, None)
@@ -547,8 +550,13 @@ def test_lines_loop(self):
547550
floop()
548551
sys.monitoring.set_events(TEST_TOOL, 0)
549552
sys.monitoring.register_callback(TEST_TOOL, E.LINE, None)
550-
start = LineMonitoringTest.test_lines_loop.__code__.co_firstlineno
551-
self.assertEqual(events, [start+7, 23, 24, 23, 24, 23, start+8])
553+
start = nth_line(LineMonitoringTest.test_lines_loop, 0)
554+
floop_1 = nth_line(floop, 1)
555+
floop_2 = nth_line(floop, 2)
556+
self.assertEqual(
557+
events,
558+
[start+7, floop_1, floop_2, floop_1, floop_2, floop_1, start+8]
559+
)
552560
finally:
553561
sys.monitoring.set_events(TEST_TOOL, 0)
554562
sys.monitoring.register_callback(TEST_TOOL, E.LINE, None)
@@ -569,8 +577,8 @@ def test_lines_two(self):
569577
sys.monitoring.set_events(TEST_TOOL, 0); sys.monitoring.set_events(TEST_TOOL2, 0)
570578
sys.monitoring.register_callback(TEST_TOOL, E.LINE, None)
571579
sys.monitoring.register_callback(TEST_TOOL2, E.LINE, None)
572-
start = LineMonitoringTest.test_lines_two.__code__.co_firstlineno
573-
expected = [start+10, 16, start+11]
580+
start = nth_line(LineMonitoringTest.test_lines_two, 0)
581+
expected = [start+10, nth_line(f1, 1), start+11]
574582
self.assertEqual(events, expected)
575583
self.assertEqual(events2, expected)
576584
finally:
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Add ``tierN`` annotation for instruction definition in interpreter DSL.
< 5F10 div aria-hidden="true" class="position-absolute top-0 d-flex user-select-none DiffLineTableCellParts-module__comment-indicator--eI0hb">
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
On macOS show a proxy icon in the title bar of editor windows to match
2+
platform behaviour.

0 commit comments

Comments
 (0)
0