diff --git a/pycmx/event.py b/pycmx/event.py index d5ef542..c9d0437 100644 --- a/pycmx/event.py +++ b/pycmx/event.py @@ -110,9 +110,9 @@ class Event: yield (s1, None) def _asc_sop_statement(self) -> Optional[StmtCdlSop]: - return next((s for s in self.statements if type(s) == StmtCdlSop), + return next((s for s in self.statements if type(s) is StmtCdlSop), None) def _asc_sat_statement(self) -> Optional[StmtCdlSat]: - return next((s for s in self.statements if type(s) == StmtCdlSat), + return next((s for s in self.statements if type(s) is StmtCdlSat), None) diff --git a/pycmx/parse_cmx_statements.py b/pycmx/parse_cmx_statements.py index 5e09b19..73bcf63 100644 --- a/pycmx/parse_cmx_statements.py +++ b/pycmx/parse_cmx_statements.py @@ -109,8 +109,8 @@ def _parse_remark(line, line_number) -> object: elif line.startswith("ASC_SOP"): group_patterns: list[str] = re.findall(r'\((.*?)\)', line) - v1: list[list[tuple[str, str]]] = [re.findall(r'(-?\d+(\.\d+)?)', a) for - a in group_patterns] + v1: list[list[tuple[str, str]]] = \ + [re.findall(r'(-?\d+(\.\d+)?)', a) for a in group_patterns] v: list[list[str]] = [[a[0] for a in b] for b in v1]