From 34858cbb48d1201bce04f253d22f1a0e265fc77e Mon Sep 17 00:00:00 2001 From: Marek Sebera Date: Fri, 4 Mar 2022 14:13:58 +0100 Subject: [PATCH] pcaptool fix for no output on invoking from console_scripts hook --- okdmr/dmrlib/tools/pcap_tool.py | 22 ++++++++++------------ 1 file changed, 10 insertions(+), 12 deletions(-) diff --git a/okdmr/dmrlib/tools/pcap_tool.py b/okdmr/dmrlib/tools/pcap_tool.py index bf4af6e..479690b 100644 --- a/okdmr/dmrlib/tools/pcap_tool.py +++ b/okdmr/dmrlib/tools/pcap_tool.py @@ -348,19 +348,17 @@ def main( arguments = sys.argv[1:] args = PcapTool._arguments().parse_args(arguments) - return ( - PcapTool.print_pcap( - files=args.files, - ports_whitelist=args.whitelist_ports, - ports_blacklist=args.blacklist_ports, - print_statistics=not args.no_statistics, - callback=EmbeddedExtractor().process_packet - if args.extract_embedded_lc - else PcapTool.debug_packet, - ) - if return_stats - else None + stats = PcapTool.print_pcap( + files=args.files, + ports_whitelist=args.whitelist_ports, + ports_blacklist=args.blacklist_ports, + print_statistics=not args.no_statistics, + callback=EmbeddedExtractor().process_packet + if args.extract_embedded_lc + else PcapTool.debug_packet, ) + if return_stats: + return stats if __name__ == "__main__":