fix py3 error in rand_str

This commit is contained in:
Thomas S Hatch 2016-04-28 19:17:22 -06:00
parent 4f9ceda7f5
commit c29c52a817

View File

@ -503,7 +503,7 @@ def rand_str(size=9999999999, hash_type=None):
if not hash_type:
hash_type = 'md5'
hasher = getattr(hashlib, hash_type)
return hasher(str(random.SystemRandom().randint(0, size))).hexdigest()
return hasher(to_bytes(str(random.SystemRandom().randint(0, size)))).hexdigest()
def which(exe=None):