Skip to content

Commit ef2e8b5

Browse files
committed
Fix use of Python 3.12 feature
1 parent fc52c3a commit ef2e8b5

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

tests/eitdata/test_loading_draeger.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import sys
12
import tempfile
23
from pathlib import Path
34

@@ -182,7 +183,8 @@ def test_event_on_first_frame(draeger_20hz_healthy_volunteer: Sequence):
182183
frame_size = _bin_file_formats["pressure_pod"]["frame_size"]
183184
ignore_bytes = event_index * frame_size # number of bytes to ignore at start of file
184185

185-
with tempfile.NamedTemporaryFile(delete_on_close=False) as temporary_file:
186+
kwargs = {"delete_on_close": False} if sys.version_info >= (3, 12) else {}
187+
with tempfile.NamedTemporaryFile(**kwargs) as temporary_file:
186188
# Create a temporary file, that is removed after the context manager is closed
187189
tempfile_path = Path(temporary_file.name)
188190
with draeger_20hz_healthy_volunteer.eit_data["raw"].path.open("rb") as original_file:

0 commit comments

Comments
 (0)