This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

classification
Title: inspect.getsource() returns the wrong lines for coroutine functions
Type: behavior Stage: resolved
Components: Library (Lib) Versions: Python 3.6, Python 3.5
process
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: Nosy List: groner, python-dev, yselivanov
Priority: normal Keywords: patch

Created on 2015-07-19 13:04 by groner, last changed 2022-04-11 14:58 by admin. This issue is now closed.

Files
File name Uploaded Description Edit
inspect-getsource-asyncdef.patch groner, 2015-07-19 13:10 Fix with tests review
Messages (3)
msg246940 - (view) Author: Kai Groner (groner) * Date: 2015-07-19 13:10
inspect.findsource() looks for lines that start with `def`.  This patch adds a clause to the regex so lines starting with `async def` will also be recognized.
msg247042 - (view) Author: Roundup Robot (python-dev) (Python triager) Date: 2015-07-21 16:04
New changeset f02c5bf59fbb by Yury Selivanov in branch '3.5':
Issue #24669: Fix inspect.getsource() for 'async def' functions.
https://hg.python.org/cpython/rev/f02c5bf59fbb

New changeset 6629773fef63 by Yury Selivanov in branch 'default':
Merge 3.5 (Issue #24669)
https://hg.python.org/cpython/rev/6629773fef63
msg247043 - (view) Author: Yury Selivanov (yselivanov) * (Python committer) Date: 2015-07-21 16:05
Thanks, Kai!
History
Date User Action Args
2022-04-11 14:58:19adminsetgithub: 68857
2015-07-21 16:05:16yselivanovsetstatus: open -> closed
versions: + Python 3.6
messages: + msg247043

resolution: fixed
stage: patch review -> resolved
2015-07-21 16:04:58python-devsetnosy: + python-dev
messages: + msg247042
2015-07-19 21:51:21berker.peksagsetnosy: + yselivanov

stage: patch review
2015-07-19 13:10:13gronersetfiles: + inspect-getsource-asyncdef.patch
keywords: + patch
messages: + msg246940
2015-07-19 13:04:29gronercreate