[Python-checkins] python/dist/src/Lib warnings.py,1.16,1.17

mhammond@users.sourceforge.net mhammond@users.sourceforge.net
Wed, 11 Sep 2002 06:22:37 -0700


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

Modified Files:
	warnings.py 
Log Message:
Ignore IOError exceptions when writing the message.

Index: warnings.py
===================================================================
RCS file: /cvsroot/python/python/dist/src/Lib/warnings.py,v
retrieving revision 1.16
retrieving revision 1.17
diff -C2 -d -r1.16 -r1.17
*** warnings.py	3 Jun 2002 15:58:32 -0000	1.16
--- warnings.py	11 Sep 2002 13:22:35 -0000	1.17
***************
*** 108,112 ****
      if file is None:
          file = sys.stderr
!     file.write(formatwarning(message, category, filename, lineno))
  
  def formatwarning(message, category, filename, lineno):
--- 108,115 ----
      if file is None:
          file = sys.stderr
!     try:
!         file.write(formatwarning(message, category, filename, lineno))
!     except IOError:
!         pass # the file (probably stderr) is invalid - this warning gets lost.
  
  def formatwarning(message, category, filename, lineno):