Quite little adjustments on tests and return value

pull/1374/head
Alexander Koeppe 2016-04-09 00:46:17 +02:00
parent 6e7b4a8221
commit 4196b8d801
1 changed files with 3 additions and 3 deletions

View File

@ -37,7 +37,7 @@ from functools import wraps
#
def asip(ip):
"""A little helper to guarantee ip being an IPAddr instance"""
return ip if isinstance(ip, IPAddr) or ip == None else IPAddr(ip)
return ip if isinstance(ip, IPAddr) or ip is None else IPAddr(ip)
def iparg(f):
"""A helper decorator to simplify use of asip throughout the code"""
@ -220,12 +220,12 @@ class IPAddr:
def isIPv4(self):
""" return true if the IP object is of address family AF_INET
"""
return True if self.family == socket.AF_INET else False
return self.family == socket.AF_INET
def isIPv6(self):
""" return true if the IP object is of address family AF_INET6
"""
return True if self.family == socket.AF_INET6 else False
return self.family == socket.AF_INET6
def getRaw(self):
""" returns the raw attribute - should only be set