Issue 5954: PyFrame_GetLineNumber - Python tracker
Issue5954
Created on 2009-05-07 07:02 by jyasskin, last changed 2022-04-11 14:56 by admin. This issue is now closed.
| Files | ||||
|---|---|---|---|---|
| File name | Uploaded | Description | Edit | |
| PyFrame_GetLineNumber.patch | jyasskin, 2009-05-07 07:02 | |||
| Messages (4) | |||
|---|---|---|---|
| msg87360 - (view) | Author: Jeffrey Yasskin (jyasskin) * ![]() |
Date: 2009-05-07 07:02 | |
Most uses of PyCode_Addr2Line (http://www.google.com/codesearch?q=PyCode_Addr2Line) are just trying to get the line number of a specified frame, but there's no way to do that directly. Forcing people to go through the code object makes them know more about the guts of the interpreter than they should need. The proposed PyFrame_GetLineNumber provides a more obvious and direct way to do the same thing. If this goes in, we might be able to deprecate PyCode_Addr2Line entirely. The uses of PyCode_Addr2Line that don't get the line of a particular frame seem to be getting the line from a traceback (for example, http://www.google.com/codesearch/p?hl=en#u_9_nDrchrw/pygame-1.7.1release/src/base.c&q=PyCode_Addr2Line), which is replaced by the tb_lineno field. |
|||
| msg87434 - (view) | Author: Antoine Pitrou (pitrou) * ![]() |
Date: 2009-05-08 10:29 | |
Please add doc to the patch, it looks ok otherwise. |
|||
| msg87478 - (view) | Author: Jeffrey Yasskin (jyasskin) * ![]() |
Date: 2009-05-08 22:25 | |
Documented and committed as r72488. This should be forward-ported to 3.x also, but since we've already started the betas for 3.1, it should probably wait for 3.2. |
|||
| msg97314 - (view) | Author: Georg Brandl (georg.brandl) * ![]() |
Date: 2010-01-06 17:31 | |
This was merged in r74132. |
|||
| History | |||
|---|---|---|---|
| Date | User | Action | Args |
| 2022-04-11 14:56:48 | admin | set | github: 50204 |
| 2010-01-06 17:31:41 | georg.brandl | set | status: open -> closed nosy: + georg.brandl messages: + msg97314 |
| 2009-05-08 22:25:03 | jyasskin | set | keywords:
- needs review messages: + msg87478 |
| 2009-05-08 10:29:29 | pitrou | set | assignee: jyasskin versions: + Python 3.1 nosy: + pitrou messages:
+ msg87434 |
| 2009-05-07 07:02:42 | jyasskin | create | |
