1. unused "import struct" removed
2. AddressFamily.__len__ is defined, but why in so way? removed.
3. comparison against instancemethod type fixed
from . import capi
import sys
import socket
-import struct
__all__ = ['Message', 'Socket', 'DumpParams', 'Object', 'Cache', 'KernelError',
'NetlinkError']
def __str__(self):
return capi.nl_af2str(self._family, 32)[0]
- def __len__(self):
- return len(str(self))
-
def __int__(self):
return self._family
from . import core as netlink
from . import capi as capi
from string import Formatter
+import types
__version__ = "1.0"
value = getattr(self._obj, key)
title = None
- if type(value) == 'instancemethod':
+ if isinstance(value, types.MethodType):
value = value()
try:
raise ValueError("Unknown converion specifier {0!s}".format(conversion))
- def nl(self):
- return '\n' + self._indent
-
def nl(self, format_string=''):
return '\n' + self._indent + self.format(format_string)