]> git.ipfire.org Git - thirdparty/dnspython.git/commitdiff
Pylint: enable superfluous-parens check 178/head
authorMartin Basti <martin.basti@gmail.com>
Sun, 26 Jun 2016 23:15:31 +0000 (01:15 +0200)
committerMartin Basti <martin.basti@gmail.com>
Sun, 26 Jun 2016 23:43:22 +0000 (01:43 +0200)
dns/e164.py
dns/entropy.py
dns/inet.py
dns/opcode.py
dns/resolver.py
dns/tokenizer.py
dns/tsig.py
pylintrc

index 8804becfdcd06039365999aeaba40ff1ea9872bb..99300730b8696c854c47b49bc5076355e5deafd3 100644 (file)
@@ -56,7 +56,7 @@ def to_e164(name, origin=public_enum_domain, want_plus_prefix=True):
     """
     if origin is not None:
         name = name.relativize(origin)
-    dlabels = [d for d in name.labels if (d.isdigit() and len(d) == 1)]
+    dlabels = [d for d in name.labels if d.isdigit() and len(d) == 1]
     if len(dlabels) != len(name.labels):
         raise dns.exception.SyntaxError('non-digit labels in ENUM domain name')
     dlabels.reverse()
index 5497882edc98b799b010c52406b119d20a5f41cd..e34092834d3238c0e65b14c07129e03b40dab02a 100644 (file)
@@ -114,7 +114,7 @@ class EntropyPool(object):
         else:
             rand = self.random_8
             max = 255
-        return (first + size * rand() // (max + 1))
+        return first + size * rand() // (max + 1)
 
 pool = EntropyPool()
 
index 966285e7e92b52fea17a4a94e4e9476fa60ce827..cc22e644f25d1bea410f745b20331498a2fc4552 100644 (file)
@@ -102,10 +102,10 @@ def is_multicast(text):
     """
     try:
         first = ord(dns.ipv4.inet_aton(text)[0])
-        return (first >= 224 and first <= 239)
+        return first >= 224 and first <= 239
     except:
         try:
             first = ord(dns.ipv6.inet_aton(text)[0])
-            return (first == 255)
+            return first == 255
         except:
             raise ValueError
index 2b2918e9939e76d15570c42e03dd992aaa75d178..70d704fb3a76f9ae86664858fd2fbd297fe41741 100644 (file)
@@ -104,6 +104,4 @@ def is_update(flags):
     @rtype: bool
     """
 
-    if (from_flags(flags) == UPDATE):
-        return True
-    return False
+    return from_flags(flags) == UPDATE
index 86a17362ea4230ac0cd01d473ac0e47f209a1e29..5ab58ec54cae1b3ec4f4a80418b939d3df3ca73e 100644 (file)
@@ -807,7 +807,7 @@ class Resolver(object):
 
                     # Based on experimentation, bit 0x1 indicates that the
                     # device is disabled.
-                    return not (flags & 0x1)
+                    return not flags & 0x1
 
                 finally:
                     device_key.Close()
index 6ac867b13a6f1ee2974b712245f7b2be1156cb1b..04b982549b9f1f9ff2fe0d738cc64c5892e8dc27 100644 (file)
@@ -96,7 +96,7 @@ class Token(object):
         return self.ttype == DELIMITER
 
     def is_eol_or_eof(self):
-        return (self.ttype == EOL or self.ttype == EOF)
+        return self.ttype == EOL or self.ttype == EOF
 
     def __eq__(self, other):
         if not isinstance(other, Token):
index b9d7bb622a357312fb2e083f852255ea87cfbdcc..c57d879fa6c9fbab9069d5b656bb00f8b13a7c41 100644 (file)
@@ -194,7 +194,7 @@ def validate(wire, keyname, secret, now, request_mac, tsig_start, tsig_rdata,
     (junk, our_mac, ctx) = sign(new_wire, keyname, secret, time, fudge,
                                 original_id, error, other_data,
                                 request_mac, ctx, multi, first, aname)
-    if (our_mac != mac):
+    if our_mac != mac:
         raise BadSignature
     return ctx
 
index befcb733378a83cd4aa775b3d75e9be1dcb31a5c..60344173816cab324e7a15dad2ae231a5a43d8fa 100644 (file)
--- a/pylintrc
+++ b/pylintrc
@@ -33,7 +33,6 @@ disable=
     protected-access,
     redefined-builtin,
     round-builtin,
-    superfluous-parens,
     too-many-lines,
     unused-argument,
     unused-variable,