This should allow people to use something like this if they want
backwards-compatibility:
try:
from Crypto.Random import get_random_bytes
except ImportError:
try:
from os import urandom as get_random_bytes
except ImportError:
get_random_bytes = open("/dev/urandom", "rb").read
RandomPoolCompat seems to give people the wrong idea that it's okay to use
RandomPool if Crypto.Random is not available.
try:
from Crypto.Random import RandomPoolCompat as RandomPool
except ImportError:
from Crypto.Util.randpool import RandomPool
In order to discourage all use of RandomPool, I'm getting rid of
RandomPoolCompat. Instead, Crypto.Util.randpool.RandomPool will be a wrapper
around Crypto.Random that emits a DeprecationWarning.
In an attempt to simplify the copyright status of PyCrypto, I'm placing my
code into the public domain, and encouraging other contributors to do the
same.
I have used a public domain dedication that was recommended in a book on FOSS legal
issues[1], followed by the warranty disclaimer boilerplate from the MIT license.
[1] _Intellectual Property and Open Source: A Practical Guide to Protecting
Code_, a book written by Van Lindberg and published by O'Reilly Media.
(ISBN 978-0-596-51796-0)
This will avoid the previous situation where scripts like the old "test.py"
get included accidentally in a release. It also frees us to put additional
build scripts in the top-level directory of the source tree.