Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
def __init__(self, *args, **kwargs):
self.__reason = kwargs.pop("reason", None)
super(ParseError, self).__init__(*args, **kwargs)
return self.__stats
ping_lines = _to_unicode(ping_message).splitlines()
parser_class_list = (
LinuxPingParser,
WindowsPingParser,
MacOsPingParser,
AlpineLinuxPingParser,
)
for parser_class in parser_class_list:
self.__parser = parser_class()
try:
self.__stats = self.__parser.parse(ping_lines)
return self.__stats
except ParseError as e:
if e.reason != ParseErrorReason.HEADER_NOT_FOUND:
raise e
except pp.ParseException:
pass
self.__parser = NullPingParser()
return self.__stats