aboutsummaryrefslogtreecommitdiff
path: root/frozen_deps/ecdsa/util.py
diff options
context:
space:
mode:
Diffstat (limited to 'frozen_deps/ecdsa/util.py')
-rw-r--r--frozen_deps/ecdsa/util.py8
1 files changed, 3 insertions, 5 deletions
diff --git a/frozen_deps/ecdsa/util.py b/frozen_deps/ecdsa/util.py
index e77d61c..9a56110 100644
--- a/frozen_deps/ecdsa/util.py
+++ b/frozen_deps/ecdsa/util.py
@@ -33,13 +33,12 @@ oid_ecDH = (1, 3, 132, 1, 12)
oid_ecMQV = (1, 3, 132, 1, 13)
-if sys.version_info >= (3,):
+if sys.version_info >= (3,): # pragma: no branch
def entropy_to_bits(ent_256):
"""Convert a bytestring to string of 0's and 1's"""
return bin(int.from_bytes(ent_256, "big"))[2:].zfill(len(ent_256) * 8)
-
else:
def entropy_to_bits(ent_256):
@@ -47,12 +46,11 @@ else:
return "".join(bin(ord(x))[2:].zfill(8) for x in ent_256)
-if sys.version_info < (2, 7):
+if sys.version_info < (2, 7): # pragma: no branch
# Can't add a method to a built-in type so we are stuck with this
def bit_length(x):
return len(bin(x)) - 2
-
else:
def bit_length(x):
@@ -99,7 +97,7 @@ class PRNG:
def __call__(self, numbytes):
a = [next(self.generator) for i in range(numbytes)]
- if PY2:
+ if PY2: # pragma: no branch
return "".join(a)
else:
return bytes(a)