From 93065324928a467fba767b95c068fefbb15deb90 Mon Sep 17 00:00:00 2001 From: Dawid Laszuk Date: Fri, 23 Aug 2024 22:23:41 -0700 Subject: [PATCH] fix: support for Python3.8 --- PyEMD/utils.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/PyEMD/utils.py b/PyEMD/utils.py index 9dd71be..4c56f99 100644 --- a/PyEMD/utils.py +++ b/PyEMD/utils.py @@ -1,8 +1,13 @@ -from functools import cache +import sys from typing import Optional import numpy as np +if sys.version_info >= (3, 9): + from functools import cache +else: + from functools import lru_cache as cache + def get_timeline(range_max: int, dtype: Optional[np.dtype] = None) -> np.ndarray: """Returns timeline array for requirements.