From ca701f92f538ddd61835a2ec252ebbb8a0b1e4de Mon Sep 17 00:00:00 2001 From: Thorsten Behrens Date: Wed, 29 Dec 2010 05:29:08 -0500 Subject: PY3K support for _fastmath.c; removed floordiv(a,b) hack and replaced with divmod(a,b)[0]; move to assertEqual throughout the test suite to prep for assert_ and failIf being removed in 3.3/3.4 --- python-3-changes.txt | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'python-3-changes.txt') diff --git a/python-3-changes.txt b/python-3-changes.txt index d1abc66..51f9455 100755 --- a/python-3-changes.txt +++ b/python-3-changes.txt @@ -31,8 +31,10 @@ Replace string.split(a) with a.split(). Replace body of white-space-stripping functions with 'return "".join(s.split())' Integer division via the "/" operator can return a float in 3.x. This causes issues in Util.number.getStrongPrime. As 2.1 does not support -the "//" operator, a helper function "floordiv()" is brought in via 'if sys.version_info' from floordiv.py or py21floordiv.py. +the "//" operator, divmod(a,b)[0] is used instead, to conform with an existing practice throughout the rest of the pycrypto code base. +Do not use assert_/failUnless or failIf. These are deprecated and are scheduled to be removed in Python 3.3 and 3.4. +Use instead assertEqual(expr,True) for assert_ and assertEqual(expr,False) for failIf C code: @@ -68,6 +70,6 @@ TODO: This is friendlier than just relying on Python's errors. - Document the expected types for functions. The cipher, the key and the input texts are byte-strings. Plaintext decodes are byte-strings currently, this needs review. In keeping with how Python 3.x's hash functions work, the input MODE is a text string. hexdigest() returns a text string, and digest() returns a byte-string. -- Compile and test _fastmath.c +- Look into LIBPATH/%LIB% and /NODEFAULTLIB:LIBCMT in setup.py for libgmp/libmpir - Go through test cases and see which modules are not covered - Look into exclusions in setup.py -- cgit v1.2.1