From a36dcbfcdd8c493cbc601d19f51d482ac5dacc8b Mon Sep 17 00:00:00 2001
From: "Stuart D. Gathman" <stuart@gathman.org>
Date: Thu, 29 Sep 2016 00:27:42 -0400
Subject: [PATCH] All unittests pass in py2 and py3!
---
Milter/dynip.py | 4 ++--
Milter/utils.py | 2 +-
testutils.py | 2 +-
3 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/Milter/dynip.py b/Milter/dynip.py
index 9fe8e1f..bb653ce 100644
--- a/Milter/dynip.py
+++ b/Milter/dynip.py
@@ -54,11 +54,11 @@ def is_dynip(host,addr):
if host.find(addr) >= 0: return True
if addr.find(':') >= 0: return False # IP6
a = addr.split('.')
- ia = map(int,a)
+ ia = list(map(int,a))
h = host
m = ip3.findall(host)
if m:
- g = map(int,m)[:4]
+ g = list(map(int,m))[:4]
ia3 = (ia[1:],ia[:3])
if g[-3:] in ia3: return True
if g[0] == ia[3] and g[1:3] == ia[:2]: return True
diff --git a/Milter/utils.py b/Milter/utils.py
index 0637ee4..9d90206 100644
--- a/Milter/utils.py
+++ b/Milter/utils.py
@@ -133,7 +133,7 @@ def parseaddr(t):
>>> parseaddr('God@heaven <@hop1.org,@hop2.net:jeff@spec.org>')
('God@heaven', 'jeff@spec.org')
>>> parseaddr('Real Name ((comment)) <addr...@example.com>')
- ('Real Name', 'addr...@example.com')
+ ('Real Name (comment)', 'addr...@example.com')
>>> parseaddr('a(WRONG)@b')
('WRONG', 'a@b')
"""
diff --git a/testutils.py b/testutils.py
index 23cafbe..fe704cc 100644
--- a/testutils.py
+++ b/testutils.py
@@ -43,7 +43,7 @@ class AddrCacheTestCase(unittest.TestCase):
def testParseHeader(self):
s='=?UTF-8?B?TGFzdCBGZXcgQ29sZHBsYXkgQWxidW0gQXJ0d29ya3MgQXZhaWxhYmxlAA?='
h = Milter.utils.parse_header(s)
- self.assertEqual(h,'Last Few Coldplay Album Artworks Available\x00')
+ self.assertEqual(h,b'Last Few Coldplay Album Artworks Available\x00')
def suite():
s = unittest.makeSuite(AddrCacheTestCase,'test')
--
GitLab