[Python-checkins] r72776 - in python/trunk: Lib/test/test_trace.py Objects/frameobject.c
jeffrey.yasskin
python-checkins at python.org
Mon May 18 23:14:54 CEST 2009
Author: jeffrey.yasskin
Date: Mon May 18 23:14:54 2009
New Revision: 72776
Log:
While I was modifying test_trace, it threw an exception when I accidentally
made it try to set the line number from the trace callback for a 'call' event.
This patch makes the error message a little more helpful in that case, and
makes it a little less likely that a future editor will make the same mistake
in test_trace.
Modified:
python/trunk/Lib/test/test_trace.py
python/trunk/Objects/frameobject.c
Modified: python/trunk/Lib/test/test_trace.py
==============================================================================
--- python/trunk/Lib/test/test_trace.py (original)
+++ python/trunk/Lib/test/test_trace.py Mon May 18 23:14:54 2009
@@ -471,7 +471,7 @@
def trace(self, frame, event, arg):
if not self.done and frame.f_code == self.function.func_code:
firstLine = frame.f_code.co_firstlineno
- if frame.f_lineno == firstLine + self.jumpFrom:
+ if event == 'line' and frame.f_lineno == firstLine + self.jumpFrom:
# Cope with non-integer self.jumpTo (because of
# no_jump_to_non_integers below).
try:
Modified: python/trunk/Objects/frameobject.c
==============================================================================
--- python/trunk/Objects/frameobject.c (original)
+++ python/trunk/Objects/frameobject.c Mon May 18 23:14:54 2009
@@ -127,7 +127,8 @@
if (!f->f_trace)
{
PyErr_Format(PyExc_ValueError,
- "f_lineno can only be set by a trace function");
+ "f_lineno can only be set by a"
+ " line trace function");
return -1;
}
More information about the Python-checkins
mailing list