diff options
| author | Bob Halley <halley@dnspython.org> | 2018-12-09 12:06:24 -0800 |
|---|---|---|
| committer | Bob Halley <halley@dnspython.org> | 2018-12-09 12:06:24 -0800 |
| commit | 129f9e79ff508e36bac08fd588769525d9214a57 (patch) | |
| tree | 8d5c0dc44ef1e232d1e87e38f1c777aba74c81ff /dns/entropy.py | |
| parent | a0a975bc26728996313425ad4ba8b1281849153c (diff) | |
| download | dnspython-129f9e79ff508e36bac08fd588769525d9214a57.tar.gz | |
Remove _compat module.
Diffstat (limited to 'dns/entropy.py')
| -rw-r--r-- | dns/entropy.py | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/dns/entropy.py b/dns/entropy.py index 00c6a4b..3b4194e 100644 --- a/dns/entropy.py +++ b/dns/entropy.py @@ -18,7 +18,6 @@ import os import random import time -from ._compat import long, binary_type try: import threading as _threading except ImportError: @@ -97,7 +96,7 @@ class EntropyPool(object): try: self._maybe_seed() if self.digest is None or self.next_byte == self.hash_len: - self.hash.update(binary_type(self.pool)) + self.hash.update(bytes(self.pool)) self.digest = bytearray(self.hash.digest()) self.stir(self.digest, True) self.next_byte = 0 @@ -115,11 +114,11 @@ class EntropyPool(object): def random_between(self, first, last): size = last - first + 1 - if size > long(4294967296): + if size > 4294967296: raise ValueError('too big') if size > 65536: rand = self.random_32 - max = long(4294967295) + max = 4294967295 elif size > 256: rand = self.random_16 max = 65535 |
