Skip to content

Commit

Permalink
Update media_file.py
Browse files Browse the repository at this point in the history
  • Loading branch information
CagtayFabry authored Sep 15, 2023
1 parent d443b62 commit e8f4b09
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions weldx/util/media_file.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
from __future__ import annotations

from pathlib import Path
from typing import Union, get_args, get_type_hints
from typing import Union, get_args

import numpy as np
import pandas as pd
Expand Down Expand Up @@ -136,8 +136,7 @@ def _init_from_sequence(
resolution=(image.width, image.height),
nframes=len(path_or_array),
)
_ref_time_types = get_type_hints(MediaFile.__init__)["reference_time"]
if not isinstance(reference_time, get_args(_ref_time_types)):
if reference_time is not None and not isinstance(reference_time, pd.Timestamp):
raise ValueError(
f"unsupported type for reference_time {type(reference_time)}"
)
Expand Down

0 comments on commit e8f4b09

Please sign in to comment.