Skip to content

Commit

Permalink
fix for python 3.9
Browse files Browse the repository at this point in the history
  • Loading branch information
benvanwerkhoven committed Jun 24, 2024
1 parent c049903 commit 1c39812
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions kernel_tuner/cache/cache.py
Original file line number Diff line number Diff line change
Expand Up @@ -272,7 +272,7 @@ def append(
benchmark_time: float,
strategy_time: int,
framework_time: float,
timestamp: datetime,
timestamp,
times: Optional[list[float]] = None,
**tune_params,
) -> None:
Expand All @@ -297,7 +297,7 @@ def append(
raise ValueError(f"Argument framework_time should be a float, received: {framework_time} ({type(framework_time)})")
if not isinstance(timestamp, datetime):
# timestamp is not a Python datetime, try to convert string to datetime
timestamp = datetime.fromisoformat(timestamp)
timestamp = datetime.fromisoformat(str(timestamp))
if times is not None and not (isinstance(times, list) and all(isinstance(time, float) for time in times)):
raise ValueError("Argument times should be a list of floats or None")

Expand Down

0 comments on commit 1c39812

Please sign in to comment.