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.

Title: inspect.getsource() returns the wrong lines for coroutine functions
Type: behavior Stage: resolved
Components: Library (Lib) Versions: Python 3.6, Python 3.5
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.

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.

New changeset 6629773fef63 by Yury Selivanov in branch 'default':
Merge 3.5 (Issue #24669)
msg247043 - (view) Author: Yury Selivanov (yselivanov) * (Python committer) Date: 2015-07-21 16:05
Thanks, Kai!
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