[Python-checkins] CVS: python/dist/src/Objects fileobject.c,2.141,2.142

Neal Norwitz nnorwitz@users.sourceforge.net
Tue, 01 Jan 2002 11:07:15 -0800


Update of /cvsroot/python/python/dist/src/Objects
In directory usw-pr-cvs1:/tmp/cvs-serv2511/Objects

Modified Files:
	fileobject.c 
Log Message:
SF Patch #494863, file.xreadlines() should raise ValueError if file is closed

This makes xreadlines behave like all other file methods
(other than close() which just returns).


Index: fileobject.c
===================================================================
RCS file: /cvsroot/python/python/dist/src/Objects/fileobject.c,v
retrieving revision 2.141
retrieving revision 2.142
diff -C2 -d -r2.141 -r2.142
*** fileobject.c	2001/11/30 14:16:36	2.141
--- fileobject.c	2002/01/01 19:07:13	2.142
***************
*** 1026,1029 ****
--- 1026,1031 ----
  	static PyObject* xreadlines_function = NULL;
  
+ 	if (f->f_fp == NULL)
+ 		return err_closed();
  	if (!xreadlines_function) {
  		PyObject *xreadlines_module =