[Python-checkins] CVS: python/dist/src/Python compile.c,2.102,2.103

Guido van Rossum python-dev@python.org
Thu, 6 Apr 2000 21:21:39 -0400 (EDT)


Update of /projects/cvsroot/python/dist/src/Python
In directory eric:/projects/python/develop/guido/src/Python
Modified Files:
	compile.c 
Log Message:
Vladimir Marangozov: This fixes the line number in the string
representation of code objects when optimization is on (python -O). It
was always reported as -1 instead of the real lineno.
Index: compile.c
===================================================================
RCS file: /projects/cvsroot/python/dist/src/Python/compile.c,v
retrieving revision 2.102
retrieving revision 2.103
diff -C2 -r2.102 -r2.103
*** compile.c	2000年03月29日 00:10:44	2.102
--- compile.c	2000年04月07日 01:21:36	2.103
***************
*** 122,132 ****
 	char buf[500];
 	int lineno = -1;
- 	unsigned char *p;
 	char *filename = "???";
 	char *name = "???";
 
! 	_PyCode_GETCODEPTR(co, &p);
! 	if (*p == SET_LINENO)
! 		lineno = (p[1] & 0xff) | ((p[2] & 0xff) << 8);
 	if (co->co_filename && PyString_Check(co->co_filename))
 		filename = PyString_AsString(co->co_filename);
--- 122,130 ----
 	char buf[500];
 	int lineno = -1;
 	char *filename = "???";
 	char *name = "???";
 
! 	if (co->co_firstlineno != 0)
! 		lineno = co->co_firstlineno;
 	if (co->co_filename && PyString_Check(co->co_filename))
 		filename = PyString_AsString(co->co_filename);

AltStyle によって変換されたページ (->オリジナル) /