Skip to content

Commit ff176f1

Browse files
Merge branch 'main' into main
2 parents 7d801d5 + 748c4b4 commit ff176f1

File tree

4 files changed

+23
-3
lines changed

4 files changed

+23
-3
lines changed

Doc/library/select.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,7 @@ The module defines the following:
115115
:ref:`kevent-objects` below for the methods supported by kevent objects.
116116

117117

118-
.. function:: select(rlist, wlist, xlist[, timeout])
118+
.. function:: select(rlist, wlist, xlist, timeout=None)
119119

120120
This is a straightforward interface to the Unix :c:func:`!select` system call.
121121
The first three arguments are iterables of 'waitable objects': either
@@ -131,7 +131,7 @@ The module defines the following:
131131
platform-dependent. (It is known to work on Unix but not on Windows.) The
132132
optional *timeout* argument specifies a time-out in seconds; it may be
133133
a non-integer to specify fractions of seconds.
134-
When the *timeout* argument is omitted the function blocks until
134+
When the *timeout* argument is omitted or ``None``, the function blocks until
135135
at least one file descriptor is ready. A time-out value of zero specifies a
136136
poll and never blocks.
137137

Lib/pdb.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,7 @@ def find_first_executable_line(code):
130130
return code.co_firstlineno
131131

132132
def find_function(funcname, filename):
133-
cre = re.compile(r'def\s+%s(\s*\[.+\])?\s*[(]' % re.escape(funcname))
133+
cre = re.compile(r'(?:async\s+)?def\s+%s(\s*\[.+\])?\s*[(]' % re.escape(funcname))
134134
try:
135135
fp = tokenize.open(filename)
136136
except OSError:

Lib/test/test_pdb.py

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4587,6 +4587,25 @@ def bar():
45874587
]))
45884588
self.assertIn('break in bar', stdout)
45894589

4590+
@unittest.skipIf(SKIP_CORO_TESTS, "Coroutine tests are skipped")
4591+
def test_async_break(self):
4592+
script = """
4593+
import asyncio
4594+
4595+
async def main():
4596+
pass
4597+
4598+
asyncio.run(main())
4599+
"""
4600+
commands = """
4601+
break main
4602+
continue
4603+
quit
4604+
"""
4605+
stdout, stderr = self.run_pdb_script(script, commands)
4606+
self.assertRegex(stdout, r"Breakpoint 1 at .*main\.py:5")
4607+
self.assertIn("pass", stdout)
4608+
45904609
def test_issue_59000(self):
45914610
script = """
45924611
def foo():
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Allow :mod:`pdb` to set breakpoints on async functions with function names.

0 commit comments

Comments
 (0)