Skip to content

Commit 4297b71

Browse files
committed
backwards compatibility
1 parent e9d641c commit 4297b71

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

RATapi/controls.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
import tempfile
44
import warnings
55
from pathlib import Path
6+
from typing import Union
67

78
import prettytable
89
from pydantic import (
@@ -222,7 +223,7 @@ def delete_IPC(self):
222223
os.remove(self._IPCFilePath)
223224
return None
224225

225-
def save(self, path: str | Path, filename: str = "controls"):
226+
def save(self, path: Union[str, Path], filename: str = "controls"):
226227
"""Save a controls object to a JSON file.
227228
228229
Parameters
@@ -235,7 +236,7 @@ def save(self, path: str | Path, filename: str = "controls"):
235236
file.write_text(self.model_dump_json())
236237

237238
@classmethod
238-
def load(cls, path: str | Path) -> "Controls":
239+
def load(cls, path: Union[str, Path]) -> "Controls":
239240
"""Load a controls object from file.
240241
241242
Parameters

tests/test_project.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
"""Test the project module."""
22

33
import copy
4+
import tempfile
45
from pathlib import Path
56
from typing import Callable
67

0 commit comments

Comments
 (0)