Skip to content

Commit

Permalink
Merge branch 'main' into fix-issue-114763
Browse files Browse the repository at this point in the history
  • Loading branch information
brettcannon committed Feb 23, 2024
2 parents 6322dd6 + 462a2fc commit 023d65d
Show file tree
Hide file tree
Showing 28 changed files with 722 additions and 305 deletions.
449 changes: 449 additions & 0 deletions Doc/howto/gdb_helpers.rst

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions Doc/howto/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ Currently, the HOWTOs are:
cporting.rst
curses.rst
descriptor.rst
gdb_helpers.rst
enum.rst
functional.rst
logging.rst
Expand Down
8 changes: 6 additions & 2 deletions Doc/library/pyexpat.rst
Original file line number Diff line number Diff line change
Expand Up @@ -214,7 +214,8 @@ XMLParser Objects
:meth:`CharacterDataHandler` callback whenever possible. This can improve
performance substantially since Expat normally breaks character data into chunks
at every line ending. This attribute is false by default, and may be changed at
any time.
any time. Note that when it is false, data that does not contain newlines
may be chunked too.


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


.. method:: xmlparser.UnparsedEntityDeclHandler(entityName, base, systemId, publicId, notationName)
Expand Down
11 changes: 10 additions & 1 deletion Lib/idlelib/editor.py
Original file line number Diff line number Diff line change
Expand Up @@ -1044,7 +1044,9 @@ def open_recent_file(fn_closure=file_name):
def saved_change_hook(self):
short = self.short_title()
long = self.long_title()
if short and long:
if short and long and not macosx.isCocoaTk():
# Don't use both values on macOS because
# that doesn't match platform conventions.
title = short + " - " + long + _py_version
elif short:
title = short
Expand All @@ -1059,6 +1061,13 @@ def saved_change_hook(self):
self.top.wm_title(title)
self.top.wm_iconname(icon)

if macosx.isCocoaTk():
# Add a proxy icon to the window title
self.top.wm_attributes("-titlepath", long)

# Maintain the modification status for the window
self.top.wm_attributes("-modified", not self.get_saved())

def get_saved(self):
return self.undo.get_saved()

Expand Down
3 changes: 3 additions & 0 deletions Lib/test/test_capi/test_opt.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
import textwrap
import unittest
import gc
import os

import _testinternalcapi

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


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

def _run_with_optimizer(self, testfunc, arg):
Expand Down
20 changes: 14 additions & 6 deletions Lib/test/test_monitoring.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,9 @@ def g1():
TEST_TOOL2 = 3
TEST_TOOL3 = 4

def nth_line(func, offset):
return func.__code__.co_firstlineno + offset

class MonitoringBasicTest(unittest.TestCase):

def test_has_objects(self):
Expand Down Expand Up @@ -529,8 +532,8 @@ def test_lines_single(self):
f1()
sys.monitoring.set_events(TEST_TOOL, 0)
sys.monitoring.register_callback(TEST_TOOL, E.LINE, None)
start = LineMonitoringTest.test_lines_single.__code__.co_firstlineno
self.assertEqual(events, [start+7, 16, start+8])
start = nth_line(LineMonitoringTest.test_lines_single, 0)
self.assertEqual(events, [start+7, nth_line(f1, 1), start+8])
finally:
sys.monitoring.set_events(TEST_TOOL, 0)
sys.monitoring.register_callback(TEST_TOOL, E.LINE, None)
Expand All @@ -547,8 +550,13 @@ def test_lines_loop(self):
floop()
sys.monitoring.set_events(TEST_TOOL, 0)
sys.monitoring.register_callback(TEST_TOOL, E.LINE, None)
start = LineMonitoringTest.test_lines_loop.__code__.co_firstlineno
self.assertEqual(events, [start+7, 23, 24, 23, 24, 23, start+8])
start = nth_line(LineMonitoringTest.test_lines_loop, 0)
floop_1 = nth_line(floop, 1)
floop_2 = nth_line(floop, 2)
self.assertEqual(
events,
[start+7, floop_1, floop_2, floop_1, floop_2, floop_1, start+8]
)
finally:
sys.monitoring.set_events(TEST_TOOL, 0)
sys.monitoring.register_callback(TEST_TOOL, E.LINE, None)
Expand All @@ -569,8 +577,8 @@ def test_lines_two(self):
sys.monitoring.set_events(TEST_TOOL, 0); sys.monitoring.set_events(TEST_TOOL2, 0)
sys.monitoring.register_callback(TEST_TOOL, E.LINE, None)
sys.monitoring.register_callback(TEST_TOOL2, E.LINE, None)
start = LineMonitoringTest.test_lines_two.__code__.co_firstlineno
expected = [start+10, 16, start+11]
start = nth_line(LineMonitoringTest.test_lines_two, 0)
expected = [start+10, nth_line(f1, 1), start+11]
self.assertEqual(events, expected)
self.assertEqual(events2, expected)
finally:
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Add ``tierN`` annotation for instruction definition in interpreter DSL.
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
On macOS show a proxy icon in the title bar of editor windows to match
platform behaviour.

0 comments on commit 023d65d

Please sign in to comment.