[Python-checkins] CVS: python/dist/src/Lib gzip.py,1.17,1.18

Jeremy Hylton python-dev@python.org
Mon, 8 May 2000 13:00:03 -0400


Update of /projects/cvsroot/python/dist/src/Lib
In directory goon.cnri.reston.va.us:/home/jhylton/python/src/Lib

Modified Files:
	gzip.py 
Log Message:
if the GzipFile constructor fails, the __del__ method is still
called.  catch the resulting AttributeError and exit cleanly.


Index: gzip.py
===================================================================
RCS file: /projects/cvsroot/python/dist/src/Lib/gzip.py,v
retrieving revision 1.17
retrieving revision 1.18
diff -C2 -r1.17 -r1.18
*** gzip.py	2000/02/04 15:39:29	1.17
--- gzip.py	2000/05/08 16:59:59	1.18
***************
*** 254,260 ****
  
      def __del__(self):
!         if (self.myfileobj is not None or
!             self.fileobj is not None):
!             self.close()
          
      def flush(self):
--- 254,264 ----
  
      def __del__(self):
!         try:
!             if (self.myfileobj is None and
!                 self.fileobj is None):
!                 return
!         except AttributeError:
!             return
!         self.close()
          
      def flush(self):