From f10b5cefd97ccc03bb78bc40b39fb41428b46ef9 Mon Sep 17 00:00:00 2001 From: Mashiro <57566630+HAOCHENYE@users.noreply.github.com> Date: Fri, 6 Jan 2023 15:40:35 +0800 Subject: [PATCH] [Docs] Clear the documentations about Python3.6 (#865) --- docs/en/get_started/installation.md | 2 +- docs/zh_cn/get_started/installation.md | 2 +- mmengine/logging/logger.py | 13 +++++-------- 3 files changed, 7 insertions(+), 10 deletions(-) diff --git a/docs/en/get_started/installation.md b/docs/en/get_started/installation.md index cb9fbf08..45a7affa 100644 --- a/docs/en/get_started/installation.md +++ b/docs/en/get_started/installation.md @@ -2,7 +2,7 @@ ## Prerequisites -- Python 3.6+ +- Python 3.7+ - PyTorch 1.6+ - CUDA 9.2+ - GCC 5.4+ diff --git a/docs/zh_cn/get_started/installation.md b/docs/zh_cn/get_started/installation.md index b50deb2f..3fbc55f3 100644 --- a/docs/zh_cn/get_started/installation.md +++ b/docs/zh_cn/get_started/installation.md @@ -2,7 +2,7 @@ ### 环境依赖 -- Python 3.6+ +- Python 3.7+ - PyTorch 1.6+ - CUDA 9.2+ - GCC 5.4+ diff --git a/mmengine/logging/logger.py b/mmengine/logging/logger.py index 2be03ab2..442bef2f 100644 --- a/mmengine/logging/logger.py +++ b/mmengine/logging/logger.py @@ -235,15 +235,12 @@ class MMLogger(Logger, ManagerMixin): level must be an int or a str. """ - # Compatible with python3.6. `logging.Logger` does not have - # `_cache` attribute in python3.6. self.level = logging._checkLevel(level) - if hasattr(self, '_cache'): - _accquire_lock() - # The same logic as `logging.Manager._clear_cache`. - for logger in MMLogger._instance_dict.values(): - logger._cache.clear() - _release_lock() + _accquire_lock() + # The same logic as `logging.Manager._clear_cache`. + for logger in MMLogger._instance_dict.values(): + logger._cache.clear() + _release_lock() def print_log(msg,