Skip to content
Snippets Groups Projects
Commit 547fb39f authored by Stuart D. Gathman's avatar Stuart D. Gathman
Browse files

More python3 fixes. Run pyip6 doctests in test suite.

parent 6e215345
Branches
No related tags found
No related merge requests found
*.pyc
build/
test/*.out
test/*.tstout
......@@ -9,7 +9,7 @@
# This code is under the GNU General Public License. See COPYING for details.
from __future__ import print_function
__version__ = '0.9.8'
__version__ = '1.0.1'
import os
import re
......
......@@ -81,7 +81,7 @@ def inet_pton(p):
(0, 0, 0, 0, 0, 65535, 258, 772)
>>> try: inet_pton('::1.2.3.4.5')
... except ValueError,x: print(x)
... except ValueError as x: print(x)
::1.2.3.4.5
"""
if p == '::':
......@@ -115,4 +115,4 @@ def inet_pton(p):
return struct.pack('!HHHHHHHH',
*[int(s,16) for s in a[0].split(':')])
except ValueError: pass
raise ValueError,p
raise ValueError(p)
......@@ -5,6 +5,7 @@ import os
import Milter.utils
from Milter.cache import AddrCache
from Milter.dynip import is_dynip
from Milter.pyip6 import inet_ntop
class AddrCacheTestCase(unittest.TestCase):
......@@ -48,6 +49,7 @@ def suite():
s = unittest.makeSuite(AddrCacheTestCase,'test')
s.addTest(doctest.DocTestSuite(Milter.utils))
s.addTest(doctest.DocTestSuite(Milter.dynip))
s.addTest(doctest.DocTestSuite(Milter.pyip6))
return s
if __name__ == '__main__':
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment