From: Bob Halley Date: Wed, 1 Jul 2020 22:47:50 +0000 (-0700) Subject: lint X-Git-Tag: v2.0.0rc2~12 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=e2a4c0c6b188b48405bc6e0e7a71f3544f2e9af0;p=thirdparty%2Fdnspython.git lint --- diff --git a/.flake8 b/.flake8 index 57d7f6c8..a294638f 100644 --- a/.flake8 +++ b/.flake8 @@ -9,6 +9,8 @@ ignore = # Not excited by the "two blank lines" rule E302, E305, + # or the one blank line rule + E306, # Ambigious variables are ok. E741, # Lines ending with binary operators are OK diff --git a/dns/tsigkeyring.py b/dns/tsigkeyring.py index aa3cae92..4afee57f 100644 --- a/dns/tsigkeyring.py +++ b/dns/tsigkeyring.py @@ -48,13 +48,12 @@ def to_text(keyring): @rtype: dict""" textring = {} - b64encode = lambda secret: base64.encodebytes(secret).decode().rstrip() + def b64encode(secret): + return base64.encodebytes(secret).decode().rstrip() for (name, key) in keyring.items(): name = name.to_text() if isinstance(key, bytes): textring[name] = b64encode(key) else: - algorithm = key.algorithm - secret = key.secret textring[name] = (key.algorithm.to_text(), b64encode(key.secret)) return textring