Skip to content

Commit

Permalink
fix: use open from pathlib instead of the builtin
Browse files Browse the repository at this point in the history
  • Loading branch information
sebclrsn committed May 23, 2023
1 parent 96b1b47 commit 0f2f2ab
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/pykiso/lib/connectors/cc_pcan_can.py
Original file line number Diff line number Diff line change
Expand Up @@ -404,7 +404,7 @@ def _merge_trc(self) -> None:
first_message_line = 33

# Get start time of the first trc file
with open(list_of_traces[0], "r") as trc:
with list_of_traces[0].open("r") as trc:
data = trc.read().splitlines(True)

first_trc_start_time = CCPCanCan._get_trace_start_time(
Expand All @@ -416,7 +416,7 @@ def _merge_trc(self) -> None:

# Append all trace files
for file in list_of_traces:
with open(file, "r") as trc:
with file.open("r") as trc:
data = trc.read().splitlines(True)

# Get offset between current and first trc file
Expand All @@ -431,7 +431,7 @@ def _merge_trc(self) -> None:
)
message_idx += len(data[first_message_line:])

with open(result_trace, "a") as merged_trc:
with result_trace.open("a") as merged_trc:
merged_trc.writelines(corrected_data)
os.remove(file)

Expand Down

0 comments on commit 0f2f2ab

Please sign in to comment.