From 063abf35e81deaf749ebbcfee339fbd1d9e89412 Mon Sep 17 00:00:00 2001 From: Vratko Polak Date: Wed, 4 Dec 2019 13:24:07 +0100 Subject: Deal with some "pylint: disable=" comments + When possible, fix the violation. + Else, add a comment: + An explanation (if not already present) and keep disable. + A TODO (if not already present) and remove the disable. - This makes tox job report more pylint violations, but any such violation is fixable and should be fixed. - Although some need to be fixed in VPP, such as enum item long names. Change-Id: I48604b5eda070083d79dff1439620dbd9e798e1f Signed-off-by: Vratko Polak --- resources/libraries/python/PacketVerifier.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'resources/libraries/python/PacketVerifier.py') diff --git a/resources/libraries/python/PacketVerifier.py b/resources/libraries/python/PacketVerifier.py index 397ce76f49..fb2337e49d 100644 --- a/resources/libraries/python/PacketVerifier.py +++ b/resources/libraries/python/PacketVerifier.py @@ -75,7 +75,6 @@ from scapy.packet import Raw # Enable libpcap's L2listen conf.use_pcap = True -import scapy.arch.pcapdnet # pylint: disable=C0413, unused-import __all__ = [ u"RxQueue", u"TxQueue", u"Interface", u"create_gratuitous_arp_request", @@ -235,7 +234,11 @@ class RxQueue(PacketVerifier): pkt_pad = str(auto_pad(pkt)) print(f"Received packet on {self._ifname} of len {len(pkt)}") if verbose: - pkt.show2() # pylint: disable=no-member + if hasattr(pkt, u"show2"): + pkt.show2() + else: + # Never happens in practice, but Pylint does not know that. + print(f"Unexpected instance: {pkt!r}") print() if pkt_pad in ignore_list: ignore_list.remove(pkt_pad) -- cgit 1.2.3-korg