Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: use open from pathlib instead of the builtin #298

Merged
merged 1 commit into from
May 24, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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