[Spambayes-checkins] spambayes timtoken.py,1.7,1.8

Guido van Rossum gvanrossum@users.sourceforge.net
Fri, 06 Sep 2002 22:43:11 -0700


Update of /cvsroot/spambayes/spambayes
In directory usw-pr-cvs1:/tmp/cvs-serv18320

Modified Files:
	timtoken.py 
Log Message:
Catch MessageParseError when calling message_from_file() too.


Index: timtoken.py
===================================================================
RCS file: /cvsroot/spambayes/spambayes/timtoken.py,v
retrieving revision 1.7
retrieving revision 1.8
diff -C2 -d -r1.7 -r1.8
*** timtoken.py	7 Sep 2002 04:50:10 -0000	1.7
--- timtoken.py	7 Sep 2002 05:43:08 -0000	1.8
***************
*** 559,563 ****
          msg = obj
      elif hasattr(obj, "readline"):
!         msg = email.message_from_file(obj)
      else:
          try:
--- 559,568 ----
          msg = obj
      elif hasattr(obj, "readline"):
!         try:
!             msg = email.message_from_file(obj)
!         except email.Errors.MessageParseError:
!             yield 'control: MessageParseError'
!             # XXX Fall back to the raw body text?
!             return
      else:
          try: