The purpose of this function is to determine if report_input_file is either in JSON format or XML format, this is what I came up with, just want to know if this is best practice / pythonic way of achieving this?def parse_report_file(self, report_input_file):     Checks if input report file is of type json or xml     parsed_report_file = None    try:        parsed_report_file = self._parse_json_file(report_input_file)        self.is_json_report_file = True    except Exception, e:        parsed_report_file = self._parse_xml_file(report_input_file)        self.is_json_report_file = False    return parsed_report_file
Determine if a file is either in JSON or XML format
python;parsing;json;xml