"""
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()
else:
rand = self.random_8
max = 255
- return (first + size * rand() // (max + 1))
+ return first + size * rand() // (max + 1)
pool = EntropyPool()
"""
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
@rtype: bool
"""
- if (from_flags(flags) == UPDATE):
- return True
- return False
+ return from_flags(flags) == UPDATE
# Based on experimentation, bit 0x1 indicates that the
# device is disabled.
- return not (flags & 0x1)
+ return not flags & 0x1
finally:
device_key.Close()
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):
(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
protected-access,
redefined-builtin,
round-builtin,
- superfluous-parens,
too-many-lines,
unused-argument,
unused-variable,