aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--mail2news.py8
-rw-r--r--news2mail.py2
-rw-r--r--setup.py2
3 files changed, 5 insertions, 7 deletions
diff --git a/mail2news.py b/mail2news.py
index eae03b0..0091cf4 100644
--- a/mail2news.py
+++ b/mail2news.py
@@ -14,9 +14,7 @@ Gets news email and sends it via SMTP.
class mail2news is hopefully conform to rfc850.
"""
-from __future__ import absolute_import
-from __future__ import print_function
-import io
+from io import StringIO
from collections import OrderedDict
import email
import logging
@@ -89,7 +87,7 @@ class mail2news(object):
"""
try:
- for key in self.message.keys():
+ for key in list(self.message.keys()):
if key.startswith('Resent-'):
if ('X-' + key) in self.message:
self.message['X-Original-' + key] = \
@@ -147,7 +145,7 @@ class mail2news(object):
others, X-*, X-Resent-* last"""
heads_dict = OrderedDict(self.message)
- for hdr in self.message.keys():
+ for hdr in list(self.message.keys()):
del self.message[hdr]
# put at top
diff --git a/news2mail.py b/news2mail.py
index aff57e0..624290f 100644
--- a/news2mail.py
+++ b/news2mail.py
@@ -134,7 +134,7 @@ class news2mail(object):
header_set = ('Received', 'From', 'To', 'Subject', 'Date')
heads_dict = OrderedDict(self.message)
- for hdr in self.message.keys():
+ for hdr in list(self.message.keys()):
del self.message[hdr]
for k in header_set:
diff --git a/setup.py b/setup.py
index 82b7d9c..e763429 100644
--- a/setup.py
+++ b/setup.py
@@ -1,6 +1,6 @@
#!/usr/bin/python
# -*- coding: utf-8 -*-
-from __future__ import print_function
+
from __future__ import absolute_import
from mail2news import VERSION, DESC