diff --git a/_modules/parsedmarc.html b/_modules/parsedmarc.html index f200374..e82ac99 100644 --- a/_modules/parsedmarc.html +++ b/_modules/parsedmarc.html @@ -203,7 +203,7 @@ new_record["alignment"]["dkim"] = dkim_aligned new_record["alignment"]["dmarc"] = dmarc_aligned if "reason" in policy_evaluated: - if type(policy_evaluated["reason"]) == list: + if type(policy_evaluated["reason"]) is list: reasons = policy_evaluated["reason"] else: reasons = [policy_evaluated["reason"]] @@ -214,7 +214,7 @@ new_record["policy_evaluated"] = new_policy_evaluated new_record["identifiers"] = record["identifiers"].copy() new_record["auth_results"] = OrderedDict([("dkim", []), ("spf", [])]) - if type(new_record["identifiers"]["header_from"]) == str: + if type(new_record["identifiers"]["header_from"]) is str: lowered_from = new_record["identifiers"]["header_from"].lower() else: lowered_from = '' @@ -404,7 +404,7 @@ new_policy_published["fo"] = fo new_report["policy_published"] = new_policy_published - if type(report["record"]) == list: + if type(report["record"]) is list: for i in range(len(report["record"])): if keep_alive is not None and i > 0 and i % 20 == 0: logger.debug("Sending keepalive cmd") @@ -460,9 +460,9 @@ """ try: - if type(input_) == str: + if type(input_) is str: file_object = open(input_, "rb") - elif type(input_) == bytes: + elif type(input_) is bytes: file_object = BytesIO(input_) else: file_object = input_ @@ -544,7 +544,7 @@ def to_str(obj): return str(obj).lower() - if type(reports) == OrderedDict: + if type(reports) is OrderedDict: reports = [reports] rows = [] @@ -800,7 +800,7 @@ Returns: list: Parsed forensic report data as a list of dicts in flat CSV format """ - if type(reports) == OrderedDict: + if type(reports) is OrderedDict: reports = [reports] rows = [] @@ -886,7 +886,7 @@ try: if is_outlook_msg(input_): input_ = convert_outlook_msg(input_) - if type(input_) == bytes: + if type(input_) is bytes: input_ = input_.decode(encoding="utf8", errors="replace") msg = mailparser.parse_from_string(input_) msg_headers = json.loads(msg.headers_json) @@ -1026,10 +1026,10 @@ Returns: OrderedDict: The parsed DMARC report """ - if type(input_) == str: + if type(input_) is str: logger.debug("Parsing {0}".format(input_)) file_object = open(input_, "rb") - elif type(input_) == bytes: + elif type(input_) is bytes: file_object = BytesIO(input_) else: file_object = input_