From f98585952bab78ac003241c17c129c025d4deabf Mon Sep 17 00:00:00 2001 From: SWHL Date: Tue, 21 May 2024 08:18:30 +0800 Subject: [PATCH] fix(python): Add the default value of maxsize in lru_cache under python3.7 for compatibility --- python/rapidocr_onnxruntime/utils/logger.py | 2 +- python/rapidocr_openvino/utils/logger.py | 2 ++ python/rapidocr_paddle/utils/logger.py | 2 ++ 3 files changed, 5 insertions(+), 1 deletion(-) diff --git a/python/rapidocr_onnxruntime/utils/logger.py b/python/rapidocr_onnxruntime/utils/logger.py index eb557ea83..3592817a4 100644 --- a/python/rapidocr_onnxruntime/utils/logger.py +++ b/python/rapidocr_onnxruntime/utils/logger.py @@ -5,7 +5,7 @@ from functools import lru_cache -@lru_cache +@lru_cache(maxsize=32) def get_logger(name: str): logger = logging.getLogger(name) logger.setLevel(logging.DEBUG) diff --git a/python/rapidocr_openvino/utils/logger.py b/python/rapidocr_openvino/utils/logger.py index ffd1cd04d..3592817a4 100644 --- a/python/rapidocr_openvino/utils/logger.py +++ b/python/rapidocr_openvino/utils/logger.py @@ -2,8 +2,10 @@ # @Author: SWHL # @Contact: liekkaskono@163.com import logging +from functools import lru_cache +@lru_cache(maxsize=32) def get_logger(name: str): logger = logging.getLogger(name) logger.setLevel(logging.DEBUG) diff --git a/python/rapidocr_paddle/utils/logger.py b/python/rapidocr_paddle/utils/logger.py index ffd1cd04d..3592817a4 100644 --- a/python/rapidocr_paddle/utils/logger.py +++ b/python/rapidocr_paddle/utils/logger.py @@ -2,8 +2,10 @@ # @Author: SWHL # @Contact: liekkaskono@163.com import logging +from functools import lru_cache +@lru_cache(maxsize=32) def get_logger(name: str): logger = logging.getLogger(name) logger.setLevel(logging.DEBUG)