make Python3 readydiff -r1.1.1.1 -r1.2 pkgsrc/math/py-roman/Makefile
(drochner)
@@ -1,21 +1,21 @@ | @@ -1,21 +1,21 @@ | |||
1 | # $NetBSD: Makefile,v 1.1.1.1 2011/10/05 07:43:12 obache Exp $ | 1 | # $NetBSD: Makefile,v 1.2 2012/08/15 17:18:14 drochner Exp $ | |
2 | # | 2 | # | |
3 | 3 | |||
4 | DISTNAME= roman-1.4.0 | 4 | DISTNAME= roman-1.4.0 | |
5 | PKGNAME= ${PYPKGPREFIX}-${DISTNAME} | 5 | PKGNAME= ${PYPKGPREFIX}-${DISTNAME} | |
6 | CATEGORIES= math | 6 | CATEGORIES= math | |
7 | MASTER_SITES= http://pypi.python.org/packages/source/r/roman/ | 7 | MASTER_SITES= http://pypi.python.org/packages/source/r/roman/ | |
8 | 8 | |||
9 | MAINTAINER= obache@NetBSD.org | 9 | MAINTAINER= obache@NetBSD.org | |
10 | HOMEPAGE= http://pypi.python.org/pypi/roman/ | 10 | HOMEPAGE= http://pypi.python.org/pypi/roman/ | |
11 | COMMENT= Integer to Roman numerals converter for Python | 11 | COMMENT= Integer to Roman numerals converter for Python | |
12 | LICENSE= python-software-foundation | 12 | LICENSE= python-software-foundation | |
13 | 13 | |||
14 | CONFLICTS+= ${PYPKGPREFIX}-docutils<=0.7 | 14 | CONFLICTS+= ${PYPKGPREFIX}-docutils<=0.7 | |
15 | 15 | |||
16 | PKG_DESTDIR_SUPPORT= user-destdir | 16 | PKG_DESTDIR_SUPPORT= user-destdir | |
17 | ||||
18 | USE_LANGUAGES= # none | 17 | USE_LANGUAGES= # none | |
18 | PYTHON_VERSIONS_INCLUDE_3X= yes | |||
19 | 19 | |||
20 | .include "../../lang/python/egg.mk" | 20 | .include "../../lang/python/egg.mk" | |
21 | .include "../../mk/bsd.pkg.mk" | 21 | .include "../../mk/bsd.pkg.mk" |
@@ -1,6 +1,6 @@ | @@ -1,6 +1,6 @@ | |||
1 | $NetBSD: distinfo,v 1.1.1.1 2011/10/05 07:43:12 obache Exp $ | 1 | $NetBSD: distinfo,v 1.2 2012/08/15 17:18:14 drochner Exp $ | |
2 | 2 | |||
3 | SHA1 (roman-1.4.0.tar.gz) = 3d9cf0c46a4e3558785a9f7c90cd96a2d31dc9b0 | 3 | SHA1 (roman-1.4.0.tar.gz) = 3d9cf0c46a4e3558785a9f7c90cd96a2d31dc9b0 | |
4 | RMD160 (roman-1.4.0.tar.gz) = 9c9f1d8de8e19f6dcab02a28b2a28a1a7f3dd546 | 4 | RMD160 (roman-1.4.0.tar.gz) = 9c9f1d8de8e19f6dcab02a28b2a28a1a7f3dd546 | |
5 | Size (roman-1.4.0.tar.gz) = 3033 bytes | 5 | Size (roman-1.4.0.tar.gz) = 3033 bytes | |
6 | SHA1 (patch-src_roman.py) = 3cbe70896a19b5d177b329f18dcb37a051f0305a | 6 | SHA1 (patch-src_roman.py) = 236d6679f2a57214dbf12598ccd3fa22bfda553b |
@@ -1,15 +1,32 @@ | @@ -1,15 +1,32 @@ | |||
1 | $NetBSD: patch-src_roman.py,v 1.1.1.1 2011/10/05 07:43:12 obache Exp $ | 1 | $NetBSD: patch-src_roman.py,v 1.2 2012/08/15 17:18:15 drochner Exp $ | |
2 | 2 | |||
3 | * replace deprecated operator `<>' with `!=' | 3 | * replace deprecated operator `<>' with `!=' | |
4 | * use 3.x compatible exception syntax | |||
4 | 5 | |||
5 | --- src/roman.py.orig 2009-07-23 16:34:18.000000000 +0000 | 6 | --- src/roman.py.orig 2009-07-23 16:34:18.000000000 +0000 | |
6 | +++ src/roman.py | 7 | +++ src/roman.py | |
7 | @@ -41,7 +41,7 @@ def toRoman(n): | 8 | @@ -40,9 +40,9 @@ romanNumeralMap = (('M', 1000), | |
9 | def toRoman(n): | |||
8 | """convert integer to Roman numeral""" | 10 | """convert integer to Roman numeral""" | |
9 | if not (0 < n < 5000): | 11 | if not (0 < n < 5000): | |
10 | raise OutOfRangeError, "number out of range (must be 1..4999)" | 12 | - raise OutOfRangeError, "number out of range (must be 1..4999)" | |
11 | - if int(n) <> n: | 13 | - if int(n) <> n: | |
14 | - raise NotIntegerError, "decimals can not be converted" | |||
15 | + raise OutOfRangeError("number out of range (must be 1..4999)") | |||
12 | + if int(n) != n: | 16 | + if int(n) != n: | |
13 | raise NotIntegerError, "decimals can not be converted" | 17 | + raise NotIntegerError("decimals can not be converted") | |
14 | 18 | |||
15 | result = "" | 19 | result = "" | |
20 | for numeral, integer in romanNumeralMap: | |||
21 | @@ -67,9 +67,9 @@ romanNumeralPattern = re.compile(""" | |||
22 | def fromRoman(s): | |||
23 | """convert Roman numeral to integer""" | |||
24 | if not s: | |||
25 | - raise InvalidRomanNumeralError, 'Input can not be blank' | |||
26 | + raise InvalidRomanNumeralError('Input can not be blank') | |||
27 | if not romanNumeralPattern.search(s): | |||
28 | - raise InvalidRomanNumeralError, 'Invalid Roman numeral: %s' % s | |||
29 | + raise InvalidRomanNumeralError('Invalid Roman numeral: %s' % s) | |||
30 | ||||
31 | result = 0 | |||
32 | index = 0 |