diff options
author | Thomas Haller <thaller@redhat.com> | 2023-07-25 13:50:16 (GMT) |
---|---|---|
committer | Thomas Haller <thaller@redhat.com> | 2023-07-25 14:01:43 (GMT) |
commit | 29b06d0fe8c85165d8a114b85af72d354821ff84 (patch) | |
tree | 3106431b6abba4a29c6f302255a5e6fd64262f88 | |
parent | 4dc1f4989b388439c417e7ad1d29500a454bb4a5 (diff) | |
download | libnl-29b06d0fe8c85165d8a114b85af72d354821ff84.zip libnl-29b06d0fe8c85165d8a114b85af72d354821ff84.tar.gz libnl-29b06d0fe8c85165d8a114b85af72d354821ff84.tar.bz2 |
python: fix flake8 warnings E741
./python/netlink/core.py:424:9: E741 ambiguous variable name 'l'
./python/netlink/route/link.py:476:13: E741 ambiguous variable name 'l'
./python/netlink/route/tc.py:554:5: E741 ambiguous variable name 'l'
./python/netlink/route/tc.py:574:5: E741 ambiguous variable name 'l'
-rw-r--r-- | python/netlink/core.py | 8 | ||||
-rw-r--r-- | python/netlink/route/link.py | 4 | ||||
-rw-r--r-- | python/netlink/route/tc.py | 12 |
3 files changed, 12 insertions, 12 deletions
diff --git a/python/netlink/core.py b/python/netlink/core.py index 1fd42dc..2c5c919 100644 --- a/python/netlink/core.py +++ b/python/netlink/core.py @@ -421,10 +421,10 @@ class Object(object): # accessing properties of subclass/subtypes (e.g. link.vlan.id) def _resolve(self, attr): obj = self - l = attr.split(".") - while len(l) > 1: - obj = getattr(obj, l.pop(0)) - return (obj, l.pop(0)) + lst = attr.split(".") + while len(lst) > 1: + obj = getattr(obj, lst.pop(0)) + return (obj, lst.pop(0)) def _setattr(self, attr, val): obj, attr = self._resolve(attr) diff --git a/python/netlink/route/link.py b/python/netlink/route/link.py index c57b96c..e6089e2 100644 --- a/python/netlink/route/link.py +++ b/python/netlink/route/link.py @@ -473,7 +473,7 @@ class Link(netlink.Object): buf += self._foreach_af("details", fmt) if stats: - l = [ + lst = [ ["Packets", RX_PACKETS, TX_PACKETS], ["Bytes", RX_BYTES, TX_BYTES], ["Errors", RX_ERRORS, TX_ERRORS], @@ -528,7 +528,7 @@ class Link(netlink.Object): util.title("TX"), ) - for row in l: + for row in lst: row[0] = util.kw(row[0]) row[1] = self.get_stat(row[1]) if row[1] else "" row[2] = self.get_stat(row[2]) if row[2] else "" diff --git a/python/netlink/route/tc.py b/python/netlink/route/tc.py index 4908c0b..daad697 100644 --- a/python/netlink/route/tc.py +++ b/python/netlink/route/tc.py @@ -551,7 +551,7 @@ _qdisc_cache = QdiscCache() def get_qdisc(ifindex, handle=None, parent=None): - l = [] + lst = [] _qdisc_cache.refill() @@ -562,16 +562,16 @@ def get_qdisc(ifindex, handle=None, parent=None): continue if (parent is not None) and (qdisc.parent != parent): continue - l.append(qdisc) + lst.append(qdisc) - return l + return lst _class_cache = {} def get_class(ifindex, parent, handle=None): - l = [] + lst = [] try: cache = _class_cache[ifindex] @@ -586,9 +586,9 @@ def get_class(ifindex, parent, handle=None): continue if (handle is not None) and (cl.handle != handle): continue - l.append(cl) + lst.append(cl) - return l + return lst _cls_cache = {} |