http://sourceforge.net/tracker/index.php?func=detail&aid=1849383&group_id=20937&atid=320937 --- pycrypto-2.0.1/Hash/MD5.py +++ pycrypto-2.0.1/Hash/MD5.py @@ -13,11 +13,14 @@ digest_size = new().digest_size except ImportError: - from md5 import * + # cannot import 'md5' from within 'MD5.py', + # because on case insensitive filesystems it will find myself. + # thus need to do the actual 'import md5' from somewhere else. + from extmd5 import * - import md5 - if hasattr(md5, 'digestsize'): + import extmd5 + if hasattr(extmd5, 'digestsize'): digest_size = digestsize del digestsize - del md5 + del extmd5 --- pycrypto-2.0.1/Hash/SHA.py +++ pycrypto-2.0.1/Hash/SHA.py @@ -13,9 +13,12 @@ digest_size = new().digest_size except ImportError: - from sha import * - import sha - if hasattr(sha, 'digestsize'): + # cannot import 'sha' from within 'SHA.py', + # because on case insensitive filesystems it will find myself. + # thus need to do the actual 'import sha' from somewhere else. + from extsha import * + import extsha + if hasattr(extsha, 'digestsize'): digest_size = digestsize del digestsize - del sha + del extsha --- pycrypto-2.0.1/Hash/extmd5/__init__.py +++ pycrypto-2.0.1/Hash/extmd5/__init__.py @@ -0,0 +1,2 @@ +# see ../MD5.py for why this is done +from md5 import * --- pycrypto-2.0.1/Hash/extsha/__init__.py +++ pycrypto-2.0.1/Hash/extsha/__init__.py @@ -0,0 +1,2 @@ +# see ../SHA.py for why this is done +from sha import * --- pycrypto-2.0.1/setup.py +++ pycrypto-2.0.1/setup.py @@ -132,7 +132,7 @@ 'url':"http://www.amk.ca/python/code/crypto", 'cmdclass' : {'build_ext':PCTBuildExt}, - 'packages' : ["Crypto", "Crypto.Hash", "Crypto.Cipher", "Crypto.Util", + 'packages' : ["Crypto", "Crypto.Hash", "Crypto.Hash.extmd5", "Crypto.Hash.extsha", "Crypto.Cipher", "Crypto.Util", "Crypto.Protocol", "Crypto.PublicKey"], 'package_dir' : { "Crypto":"." }, # One module is defined here, because build_ext won't be