diff options
author | drochner <drochner@pkgsrc.org> | 2012-08-15 17:18:14 +0000 |
---|---|---|
committer | drochner <drochner@pkgsrc.org> | 2012-08-15 17:18:14 +0000 |
commit | f3d320cc977fccf52aaca12f674b01f1796869de (patch) | |
tree | a80ab495c484b99b5b859fbaae5d6b68feba190e /math | |
parent | 9a5d3bc33daa97da61ff742c9a3e2cbf1f1c4561 (diff) | |
download | pkgsrc-f3d320cc977fccf52aaca12f674b01f1796869de.tar.gz |
make Python3 ready
Diffstat (limited to 'math')
-rw-r--r-- | math/py-roman/Makefile | 4 | ||||
-rw-r--r-- | math/py-roman/distinfo | 4 | ||||
-rw-r--r-- | math/py-roman/patches/patch-src_roman.py | 25 |
3 files changed, 25 insertions, 8 deletions
diff --git a/math/py-roman/Makefile b/math/py-roman/Makefile index fe63e0e7b80..d55889dedd0 100644 --- a/math/py-roman/Makefile +++ b/math/py-roman/Makefile @@ -1,4 +1,4 @@ -# $NetBSD: Makefile,v 1.1.1.1 2011/10/05 07:43:12 obache Exp $ +# $NetBSD: Makefile,v 1.2 2012/08/15 17:18:14 drochner Exp $ # DISTNAME= roman-1.4.0 @@ -14,8 +14,8 @@ LICENSE= python-software-foundation CONFLICTS+= ${PYPKGPREFIX}-docutils<=0.7 PKG_DESTDIR_SUPPORT= user-destdir - USE_LANGUAGES= # none +PYTHON_VERSIONS_INCLUDE_3X= yes .include "../../lang/python/egg.mk" .include "../../mk/bsd.pkg.mk" diff --git a/math/py-roman/distinfo b/math/py-roman/distinfo index 2e976ad385b..e38f3a29639 100644 --- a/math/py-roman/distinfo +++ b/math/py-roman/distinfo @@ -1,6 +1,6 @@ -$NetBSD: distinfo,v 1.1.1.1 2011/10/05 07:43:12 obache Exp $ +$NetBSD: distinfo,v 1.2 2012/08/15 17:18:14 drochner Exp $ SHA1 (roman-1.4.0.tar.gz) = 3d9cf0c46a4e3558785a9f7c90cd96a2d31dc9b0 RMD160 (roman-1.4.0.tar.gz) = 9c9f1d8de8e19f6dcab02a28b2a28a1a7f3dd546 Size (roman-1.4.0.tar.gz) = 3033 bytes -SHA1 (patch-src_roman.py) = 3cbe70896a19b5d177b329f18dcb37a051f0305a +SHA1 (patch-src_roman.py) = 236d6679f2a57214dbf12598ccd3fa22bfda553b diff --git a/math/py-roman/patches/patch-src_roman.py b/math/py-roman/patches/patch-src_roman.py index b59e7002972..27d823fe00c 100644 --- a/math/py-roman/patches/patch-src_roman.py +++ b/math/py-roman/patches/patch-src_roman.py @@ -1,15 +1,32 @@ -$NetBSD: patch-src_roman.py,v 1.1.1.1 2011/10/05 07:43:12 obache Exp $ +$NetBSD: patch-src_roman.py,v 1.2 2012/08/15 17:18:15 drochner Exp $ * replace deprecated operator `<>' with `!=' +* use 3.x compatible exception syntax --- src/roman.py.orig 2009-07-23 16:34:18.000000000 +0000 +++ src/roman.py -@@ -41,7 +41,7 @@ def toRoman(n): +@@ -40,9 +40,9 @@ romanNumeralMap = (('M', 1000), + def toRoman(n): """convert integer to Roman numeral""" if not (0 < n < 5000): - raise OutOfRangeError, "number out of range (must be 1..4999)" +- raise OutOfRangeError, "number out of range (must be 1..4999)" - if int(n) <> n: +- raise NotIntegerError, "decimals can not be converted" ++ raise OutOfRangeError("number out of range (must be 1..4999)") + if int(n) != n: - raise NotIntegerError, "decimals can not be converted" ++ raise NotIntegerError("decimals can not be converted") result = "" + for numeral, integer in romanNumeralMap: +@@ -67,9 +67,9 @@ romanNumeralPattern = re.compile(""" + def fromRoman(s): + """convert Roman numeral to integer""" + if not s: +- raise InvalidRomanNumeralError, 'Input can not be blank' ++ raise InvalidRomanNumeralError('Input can not be blank') + if not romanNumeralPattern.search(s): +- raise InvalidRomanNumeralError, 'Invalid Roman numeral: %s' % s ++ raise InvalidRomanNumeralError('Invalid Roman numeral: %s' % s) + + result = 0 + index = 0 |