aboutsummaryrefslogtreecommitdiffstats
path: root/mail2news.py
diff options
context:
space:
mode:
Diffstat (limited to 'mail2news.py')
-rw-r--r--mail2news.py10
1 files changed, 4 insertions, 6 deletions
diff --git a/mail2news.py b/mail2news.py
index 3011a4e..e7cbcf9 100644
--- a/mail2news.py
+++ b/mail2news.py
@@ -14,11 +14,9 @@ Gets news email and sends it via SMTP.
class mail2news is hopefully conform to rfc850.
"""
-
import sys
from os import getpid
from socket import gethostbyaddr, gethostname
-import string
from re import findall
import nntplib
import pyginfo
@@ -79,14 +77,14 @@ class mail2news:
# if it is a multi-line header like Received:
if line[0] not in [' ', '\t']:
try:
- head, value = string.split(line, ' ', 1)
- except string.index_error:
+ head, value = line.split(' ', 1)
+ except ValueError:
value = ''
self.smtpheads[head] = value
else:
self.smtpheads[head] = '%s%s' % \
(self.smtpheads[head], line)
- except (string.index_error), message:
+ except (ValueError), message:
print('line: %s' % line)
print('(probably missing couple "Header: value" in %s)'
% line)
@@ -95,7 +93,7 @@ class mail2news:
elif len(line) > 0 and body:
self.body.append(line)
- except (string.index_error), message:
+ except (ValueError), message:
print message
sys.exit(1)