diff options
author | Коренберг Марк (ноутбук дома) <socketpair@gmail.com> | 2012-06-04 17:20:24 (GMT) |
---|---|---|
committer | Коренберг Марк (ноутбук дома) <socketpair@gmail.com> | 2012-06-08 16:26:35 (GMT) |
commit | fb890a5b5e769a6ca7e639e004c06c6e3bbc46d3 (patch) | |
tree | faca4bce65a59100f94084bac8e5923500e88907 /python/netlink/util.py | |
parent | c1547d90d70016c04c35a3ad2ff42190eb4de18a (diff) | |
download | libnl-fb890a5b5e769a6ca7e639e004c06c6e3bbc46d3.zip libnl-fb890a5b5e769a6ca7e639e004c06c6e3bbc46d3.tar.gz libnl-fb890a5b5e769a6ca7e639e004c06c6e3bbc46d3.tar.bz2 |
Code cleanups
1. unused "import struct" removed
2. AddressFamily.__len__ is defined, but why in so way? removed.
3. comparison against instancemethod type fixed
Diffstat (limited to 'python/netlink/util.py')
-rw-r--r-- | python/netlink/util.py | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/python/netlink/util.py b/python/netlink/util.py index f6e7dec..73a211d 100644 --- a/python/netlink/util.py +++ b/python/netlink/util.py @@ -13,6 +13,7 @@ from __future__ import absolute_import from . import core as netlink from . import capi as capi from string import Formatter +import types __version__ = "1.0" @@ -82,7 +83,7 @@ class MyFormatter(Formatter): value = getattr(self._obj, key) title = None - if type(value) == 'instancemethod': + if isinstance(value, types.MethodType): value = value() try: @@ -144,9 +145,6 @@ class MyFormatter(Formatter): 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) |