diff --git a/README.md b/README.md index b4a309bc..94a0baa4 100644 --- a/README.md +++ b/README.md @@ -2,8 +2,6 @@ [![PyPI - Python Version](https://img.shields.io/pypi/pyversions/scapy-packet_viewer.svg)](https://pypi.org/project/scapy-packet_viewer/) [![Documentation Status](https://readthedocs.org/projects/scapy-packet_viewer/badge/?version=latest)](https://scapy-packet_viewer.readthedocs.io/en/latest/?badge=latest) -TODO: non-Travis build status - # scapy-packet_viewer # Packet viewer for SecDev's [Scapy](https://scapy.net/). diff --git a/scapy_packet_viewer/main_window.py b/scapy_packet_viewer/main_window.py index b6a30dad..7bd8113f 100644 --- a/scapy_packet_viewer/main_window.py +++ b/scapy_packet_viewer/main_window.py @@ -358,15 +358,24 @@ def filter_changed(self, new_filter): for checkbox in self.packet_view.body: checkbox.base_widget.state = False return - + + attribute_error_count = 0 + last_exception = None try: compiled_code = compile(new_filter, filename="", mode="eval") for checkbox in self.packet_view.body: p = checkbox.base_widget.tag # See text_to_packet() for some explanations global_scope = {"p": p, "__builtins__": {"len": len}} - matches = bool(eval(compiled_code, global_scope)) # pylint: disable=eval-used - checkbox.base_widget.state = matches + try: + matches = bool(eval(compiled_code, global_scope)) # pylint: disable=eval-used + checkbox.base_widget.state = matches + except AttributeError as e: + attribute_error_count += 1 + last_exception = e + # Suppress attribute errors, if they don't apply for all packets in packet_view.body + if len(self.packet_view.body) == attribute_error_count: + raise last_exception except NameError: self._emit( "info_popup",