[Python-checkins] python/dist/src/Lib inspect.py,1.50,1.51

rhettinger at users.sourceforge.net rhettinger at users.sourceforge.net
Tue Jun 15 07:22:56 EDT 2004


Update of /cvsroot/python/python/dist/src/Lib
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv26133

Modified Files:
	inspect.py 
Log Message:
SF bug #973092:  inspect.getframeinfo bug if 'context' is to big

Make sure the start argument is not negative.



Index: inspect.py
===================================================================
RCS file: /cvsroot/python/python/dist/src/Lib/inspect.py,v
retrieving revision 1.50
retrieving revision 1.51
diff -C2 -d -r1.50 -r1.51
*** inspect.py	5 Jun 2004 14:11:59 -0000	1.50
--- inspect.py	15 Jun 2004 11:22:53 -0000	1.51
***************
*** 757,761 ****
          else:
              start = max(start, 1)
!             start = min(start, len(lines) - context)
              lines = lines[start:start+context]
              index = lineno - 1 - start
--- 757,761 ----
          else:
              start = max(start, 1)
!             start = max(0, min(start, len(lines) - context))
              lines = lines[start:start+context]
              index = lineno - 1 - start




More information about the Python-checkins mailing list