Message266889
| Author |
JelleZijlstra |
| Recipients |
JelleZijlstra, nedbat, sdeibel, terry.reedy |
| Date |
2016年06月02日.17:06:41 |
| SpamBayes Score |
-1.0 |
| Marked as misclassified |
Yes |
| Message-id |
<1464887201.88.0.64983255054.issue13548@psf.upfronthosting.co.za> |
| In-reply-to |
| Content |
The reason for this behavior is that the trace function is called whenever execution in the bytecode jumps to a new source line. See ceval.c line 4440 or so:
/* If the last instruction falls at the start of a line or if
it represents a jump backwards, update the frame's line
number and call the trace function. */
Running dis.dis on x in the example file shows that the bytecode for returning None is assigned to the "pass" line.
I think the bug here is really with the line number assignment in the bytecode, not with the tracing, but I don't see an obvious way to fix it. |
|
History
|
|---|
| Date |
User |
Action |
Args |
| 2016年06月02日 17:06:42 | JelleZijlstra | set | recipients:
+ JelleZijlstra, terry.reedy, sdeibel, nedbat |
| 2016年06月02日 17:06:41 | JelleZijlstra | set | messageid: <1464887201.88.0.64983255054.issue13548@psf.upfronthosting.co.za> |
| 2016年06月02日 17:06:41 | JelleZijlstra | link | issue13548 messages |
| 2016年06月02日 17:06:41 | JelleZijlstra | create |
|