aboutsummaryrefslogtreecommitdiff
path: root/urllib3/util/ssl_.py
diff options
context:
space:
mode:
Diffstat (limited to 'urllib3/util/ssl_.py')
-rw-r--r--urllib3/util/ssl_.py5
1 files changed, 2 insertions, 3 deletions
diff --git a/urllib3/util/ssl_.py b/urllib3/util/ssl_.py
index dee4b87..9cfe2d2 100644
--- a/urllib3/util/ssl_.py
+++ b/urllib3/util/ssl_.py
@@ -34,10 +34,9 @@ def assert_fingerprint(cert, fingerprint):
}
fingerprint = fingerprint.replace(':', '').lower()
+ digest_length, odd = divmod(len(fingerprint), 2)
- digest_length, rest = divmod(len(fingerprint), 2)
-
- if rest or digest_length not in hashfunc_map:
+ if odd or digest_length not in hashfunc_map:
raise SSLError('Fingerprint is of invalid length.')
# We need encode() here for py32; works on py2 and p33.