Skip to content

Commit bd8b053

Browse files
committed
Merge remote-tracking branch 'upstream/main'
2 parents 276f38f + d1df81a commit bd8b053

File tree

14 files changed

+46
-35
lines changed

14 files changed

+46
-35
lines changed

Include/internal/pycore_frame.h

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -87,12 +87,12 @@ static inline void _PyFrame_StackPush(InterpreterFrame *f, PyObject *value) {
8787

8888
void _PyFrame_Copy(InterpreterFrame *src, InterpreterFrame *dest);
8989

90+
/* Consumes reference to func */
9091
static inline void
9192
_PyFrame_InitializeSpecials(
9293
InterpreterFrame *frame, PyFunctionObject *func,
9394
PyObject *locals, int nlocalsplus)
9495
{
95-
Py_INCREF(func);
9696
frame->f_func = func;
9797
frame->f_code = (PyCodeObject *)Py_NewRef(func->func_code);
9898
frame->f_builtins = func->func_builtins;
@@ -166,9 +166,6 @@ _PyFrame_FastToLocalsWithError(InterpreterFrame *frame);
166166
void
167167
_PyFrame_LocalsToFast(InterpreterFrame *frame, int clear);
168168

169-
InterpreterFrame *_PyThreadState_PushFrame(
170-
PyThreadState *tstate, PyFunctionObject *func, PyObject *locals);
171-
172169
extern InterpreterFrame *
173170
_PyThreadState_BumpFramePointerSlow(PyThreadState *tstate, size_t size);
174171

@@ -189,6 +186,7 @@ _PyThreadState_BumpFramePointer(PyThreadState *tstate, size_t size)
189186

190187
void _PyThreadState_PopFrame(PyThreadState *tstate, InterpreterFrame *frame);
191188

189+
/* Consume reference to func */
192190
InterpreterFrame *
193191
_PyFrame_Push(PyThreadState *tstate, PyFunctionObject *func);
194192

Lib/idlelib/NEWS.txt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,9 @@ Released on 2022-10-03
44
=========================
55

66

7+
bpo-46630: Make query dialogs on Windows start with a cursor in the
8+
entry box.
9+
710
bpo-46591: Make the IDLE doc URL on the About IDLE dialog clickable.
811

912
bpo-45296: Clarify close, quit, and exit in IDLE. In the File menu,

Lib/idlelib/pyparse.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -179,7 +179,7 @@ def find_good_parse_start(self, is_char_in_string):
179179
# Peeking back worked; look forward until _synchre no longer
180180
# matches.
181181
i = pos + 1
182-
while (m := _synchre(code, i)):
182+
while m := _synchre(code, i):
183183
s, i = m.span()
184184
if not is_char_in_string(s):
185185
pos = s

Lib/idlelib/query.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,7 @@ def __init__(self, parent, title, message, *, text0='', used_names={},
8383

8484
if not _utest:
8585
self.deiconify() # Unhide now that geometry set.
86+
self.entry.focus_set()
8687
self.wait_window()
8788

8889
def create_widgets(self, ok_text='OK'): # Do not replace.
@@ -100,7 +101,6 @@ def create_widgets(self, ok_text='OK'): # Do not replace.
100101
text=self.message)
101102
self.entryvar = StringVar(self, self.text0)
102103
self.entry = Entry(frame, width=30, textvariable=self.entryvar)
103-
self.entry.focus_set()
104104
self.error_font = Font(name='TkCaptionFont',
105105
exists=True, root=self.parent)
106106
self.entry_error = Label(frame, text=' ', foreground='red',

Lib/idlelib/replace.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -158,8 +158,8 @@ def replace_all(self, event=None):
158158
first = last = None
159159
# XXX ought to replace circular instead of top-to-bottom when wrapping
160160
text.undo_block_start()
161-
while (res := self.engine.search_forward(
162-
text, prog, line, col, wrap=False, ok=ok)):
161+
while res := self.engine.search_forward(
162+
text, prog, line, col, wrap=False, ok=ok):
163163
line, m = res
164164
chars = text.get("%d.0" % line, "%d.0" % (line+1))
165165
orig = m.group()

Lib/idlelib/run.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -482,7 +482,7 @@ def read(self, size=-1):
482482
result = self._line_buffer
483483
self._line_buffer = ''
484484
if size < 0:
485-
while (line := self.shell.readline()):
485+
while line := self.shell.readline():
486486
result += line
487487
else:
488488
while len(result) < size:
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Make query dialogs on Windows start with a cursor in the entry box.
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Expose Linux's ``IP_BIND_ADDRESS_NO_PORT`` option in :mod:`socket`.

Modules/socketmodule.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8072,6 +8072,9 @@ PyInit__socket(void)
80728072
#ifdef IP_TRANSPARENT
80738073
PyModule_AddIntMacro(m, IP_TRANSPARENT);
80748074
#endif
8075+
#ifdef IP_BIND_ADDRESS_NO_PORT
8076+
PyModule_AddIntMacro(m, IP_BIND_ADDRESS_NO_PORT);
8077+
#endif
80758078

80768079
/* IPv6 [gs]etsockopt options, defined in RFC2553 */
80778080
#ifdef IPV6_JOIN_GROUP

Objects/frameobject.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -784,6 +784,8 @@ _Py_IDENTIFIER(__builtins__);
784784
static void
785785
init_frame(InterpreterFrame *frame, PyFunctionObject *func, PyObject *locals)
786786
{
787+
/* _PyFrame_InitializeSpecials consumes reference to func */
788+
Py_INCREF(func);
787789
PyCodeObject *code = (PyCodeObject *)func->func_code;
788790
_PyFrame_InitializeSpecials(frame, func, locals, code->co_nlocalsplus);
789791
for (Py_ssize_t i = 0; i < code->co_nlocalsplus; i++) {

0 commit comments

Comments
 (0)