From 59249cf503f88c4c47b0c204a62395f058c662b3 Mon Sep 17 00:00:00 2001 From: David Reid Date: Mon, 24 Feb 2014 10:27:55 -0800 Subject: Select all errors, warnings, and flakes. This makes sure we're taken care of incase more stuff ever gets added to the default ignores for flake8. --- tox.ini | 1 + 1 file changed, 1 insertion(+) diff --git a/tox.ini b/tox.ini index 5ff08779..4248db38 100644 --- a/tox.ini +++ b/tox.ini @@ -41,3 +41,4 @@ commands = flake8 . [flake8] exclude = .tox,*.egg +select = E,W,F -- cgit v1.2.3 From 3eaf823260b289993e09515482f1506d521f1d15 Mon Sep 17 00:00:00 2001 From: David Reid Date: Mon, 24 Feb 2014 10:34:08 -0800 Subject: Fix issues found in hotp with new flake8 configuration. --- cryptography/hazmat/primitives/twofactor/hotp.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/cryptography/hazmat/primitives/twofactor/hotp.py b/cryptography/hazmat/primitives/twofactor/hotp.py index 535a94c7..a5c88dae 100644 --- a/cryptography/hazmat/primitives/twofactor/hotp.py +++ b/cryptography/hazmat/primitives/twofactor/hotp.py @@ -37,7 +37,7 @@ class HOTP(object): def generate(self, counter): truncated_value = self._dynamic_truncate(counter) - hotp = truncated_value % (10**self._length) + hotp = truncated_value % (10 ** self._length) return "{0:0{1}}".format(hotp, self._length).encode() def verify(self, hotp, counter): @@ -52,5 +52,5 @@ class HOTP(object): offset_bits = six.indexbytes(hmac_value, 19) & 0b1111 offset = int(offset_bits) - P = hmac_value[offset:offset+4] + P = hmac_value[offset:offset + 4] return struct.unpack(">I", P)[0] & 0x7fffffff -- cgit v1.2.3