Skip to content

Commit

Permalink
Use typing.Union for py3.8
Browse files Browse the repository at this point in the history
  • Loading branch information
domstoppable committed Jul 26, 2024
1 parent a0c291d commit 37bb8e6
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/pupil_labs/neon_recording/neon_recording.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import json
import pathlib
from typing import Union

from . import structlog
from .calib import Calibration, _parse_calib_bin
Expand Down Expand Up @@ -29,12 +30,12 @@ class NeonRecording:
* `streams` (dict): data streams of the recording
"""

def __init__(self, rec_dir_in: pathlib.Path | str):
def __init__(self, rec_dir_in: Union[pathlib.Path, str]):
"""
Initialize the NeonRecording object
Args:
rec_dir_in (pathlib.Path | str): Path to the recording directory.
rec_dir_in: Path to the recording directory.
Raises:
FileNotFoundError: If the directory does not exist or is not valid.
Expand Down Expand Up @@ -182,7 +183,7 @@ def audio(self) -> AudioStream:
return self.streams["audio"]


def load(rec_dir_in: pathlib.Path | str) -> NeonRecording:
def load(rec_dir_in: Union[pathlib.Path, str]) -> NeonRecording:
"""
Load a :class:`.NeonRecording`
"""
Expand Down

0 comments on commit 37bb8e6

Please sign in to comment.