urandom/extmath.py: make python3 compatible