diff options
-rw-r--r-- | python/netlink/route/tc.py | 4 | ||||
-rw-r--r-- | python/netlink/util.py | 2 |
2 files changed, 3 insertions, 3 deletions
diff --git a/python/netlink/route/tc.py b/python/netlink/route/tc.py index daad697..eb0037e 100644 --- a/python/netlink/route/tc.py +++ b/python/netlink/route/tc.py @@ -596,7 +596,7 @@ _cls_cache = {} def get_cls(ifindex, parent, handle=None): - chain = _cls_cache.get(ifindex, dict()) + chain = _cls_cache.get(ifindex, {}) try: cache = chain[parent] @@ -607,6 +607,6 @@ def get_cls(ifindex, parent, handle=None): cache.refill() if handle is None: - return [cls for cls in cache] + return list(cache) return [cls for cls in cache if cls.handle == handle] diff --git a/python/netlink/util.py b/python/netlink/util.py index afe7ef0..3adc509 100644 --- a/python/netlink/util.py +++ b/python/netlink/util.py @@ -103,7 +103,7 @@ class MyFormatter(Formatter): if not isinstance(value, property): raise ValueError("Invalid formatting string {0}".format(key)) - d = getattr(value.fget, "formatinfo", dict()) + d = getattr(value.fget, "formatinfo", {}) # value = value.fget() is exactly the same value = getattr(self._obj, key) |