]> git.ipfire.org Git - thirdparty/dnspython.git/commitdiff
lint
authorBob Halley <halley@play-bow.org>
Wed, 1 Jul 2020 22:47:50 +0000 (15:47 -0700)
committerBob Halley <halley@play-bow.org>
Wed, 1 Jul 2020 22:47:50 +0000 (15:47 -0700)
.flake8
dns/tsigkeyring.py

diff --git a/.flake8 b/.flake8
index 57d7f6c8b8809c35506b90fb7d5675f6c622b3f5..a294638fc2c0601e3d551e2c484520c9415e5e0f 100644 (file)
--- 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
index aa3cae92f8649218a67ddcf2de0bf89c5a84c150..4afee57fa378abae07e72e10aad62ab56763fc80 100644 (file)
@@ -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