From ed0912fb0f3d34e28d9a2ea392103a937f91bba9 Mon Sep 17 00:00:00 2001 From: Matěj Cepl Date: Fri, 4 Nov 2022 13:31:36 +0100 Subject: Run 2to3 --- mail2news.py | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) (limited to 'mail2news.py') 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 -- cgit