From: Cameron Dale Date: Sun, 9 Dec 2007 03:18:03 +0000 (-0800) Subject: Remove the obsolete whrandom module and use random instead. X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=2852f1c4e2cc9afb3723ff04f4586e35281420fc;p=quix0rs-apt-p2p.git Remove the obsolete whrandom module and use random instead. --- diff --git a/khash.py b/khash.py index f750dea..8a5bc61 100644 --- a/khash.py +++ b/khash.py @@ -2,7 +2,7 @@ # see LICENSE.txt for license information from sha import sha -import whrandom +import random #this is ugly, hopefully os.entropy will be in 2.4 try: @@ -11,7 +11,7 @@ except ImportError: def entropy(n): s = '' for i in range(n): - s += chr(whrandom.randint(0,255)) + s += chr(random.randint(0,255)) return s def intify(hstr): diff --git a/knet.py b/knet.py index 4067f84..e974a79 100644 --- a/knet.py +++ b/knet.py @@ -5,7 +5,7 @@ from khashmir import Khashmir from twisted.internet import reactor -from whrandom import randrange +from random import randrange import sys, os class Network: diff --git a/test_khashmir.py b/test_khashmir.py index 3f4908f..e9c426a 100644 --- a/test_khashmir.py +++ b/test_khashmir.py @@ -3,7 +3,7 @@ from khashmir import * import khash from copy import copy -from whrandom import randrange +from random import randrange import os