Index: lib/inspect.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/inspect.py,v retrieving revision 1.49 diff -c -r1.49 inspect.py *** lib/inspect.py 1 Dec 2003 20:12:15 -0000 1.49 --- lib/inspect.py 5 Jun 2004 11:31:20 -0000 *************** *** 731,737 **** return '(' + string.join(specs, ', ') + ')' # -------------------------------------------------- stack frame extraction ! def getframeinfo(frame, context=1): """Get information about a frame or traceback object. A tuple of five things is returned: the filename, the line number of --- 731,737 ---- return '(' + string.join(specs, ', ') + ')' # -------------------------------------------------- stack frame extraction ! def getframeinfo(frame, context=1, lineno=None): """Get information about a frame or traceback object. A tuple of five things is returned: the filename, the line number of *************** *** 745,751 **** raise TypeError('arg is not a frame or traceback object') filename = getsourcefile(frame) or getfile(frame) ! lineno = frame.f_lineno if context > 0: start = lineno - 1 - context//2 try: --- 745,751 ---- raise TypeError('arg is not a frame or traceback object') filename = getsourcefile(frame) or getfile(frame) ! if lineno is None: lineno = frame.f_lineno if context > 0: start = lineno - 1 - context//2 try: *************** *** 785,791 **** name, a list of lines of context, and index within the context.""" framelist = [] while tb: ! framelist.append((tb.tb_frame,) + getframeinfo(tb, context)) tb = tb.tb_next return framelist --- 785,791 ---- name, a list of lines of context, and index within the context.""" framelist = [] while tb: ! framelist.append((tb.tb_frame,) + getframeinfo(tb, context,lineno=tb.tb_lineno)) tb = tb.tb_next return framelist Index: lib/test/test_inspect.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/test/test_inspect.py,v retrieving revision 1.13 diff -c -r1.13 test_inspect.py *** lib/test/test_inspect.py 31 Oct 2003 15:35:53 -0000 1.13 --- lib/test/test_inspect.py 5 Jun 2004 11:31:21 -0000 *************** *** 158,165 **** istest(inspect.isframe, 'mod.fr') test(len(git.tr) == 3, 'trace() length') ! test(git.tr[0][1:] == (TESTFN, 46, 'argue', ! [' self.tr = inspect.trace()\n'], 0), 'trace() row 2') test(git.tr[1][1:] == (TESTFN, 9, 'spam', [' eggs(b + d, c + f)\n'], 0), 'trace() row 2') --- 158,165 ---- istest(inspect.isframe, 'mod.fr') test(len(git.tr) == 3, 'trace() length') ! test(git.tr[0][1:] == (TESTFN, 43, 'argue', ! [' spam(a, b, c)\n'], 0), 'trace() row 2') test(git.tr[1][1:] == (TESTFN, 9, 'spam', [' eggs(b + d, c + f)\n'], 0), 'trace() row 2')