Message111003
trace.py uses settrace to do its heavy lifting. In the "local trace" function for counting, localtrace_count:
def localtrace_count(self, frame, why, arg):
if why == "line":
filename = frame.f_code.co_filename
lineno = frame.f_lineno
key = filename, lineno
self.counts[key] = self.counts.get(key, 0) + 1
return self.localtrace
The line "filename = frame.f_code.co_filename" seems to work as expected in 2.x for the current file, returning its name. In 3.x it returns '<string>' for the current file.
This causes the trace module to filter out the results for the current file (traceme.py in Alexander's example).
I'm investigating further, but this may very well be caused by different behavior of `f_code.co_filename` between Python 2 and 3. |
|
Date |
User |
Action |
Args |
2010-07-21 04:13:24 | eli.bendersky | set | recipients:
+ eli.bendersky, terry.reedy, belopolsky |
2010-07-21 04:13:23 | eli.bendersky | set | messageid: <1279685603.48.0.352825379998.issue9317@psf.upfronthosting.co.za> |
2010-07-21 04:13:20 | eli.bendersky | link | issue9317 messages |
2010-07-21 04:13:20 | eli.bendersky | create | |
|