From 41d6c24e9feef7d1654bebec1a70d4e7ad92b2ff Mon Sep 17 00:00:00 2001 From: allegroai <> Date: Fri, 23 Jul 2021 16:05:59 +0300 Subject: [PATCH] Fix internal logging.Logger pickle fix (only applies to py <= 3.6) --- clearml/debugging/log.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/clearml/debugging/log.py b/clearml/debugging/log.py index b3057f10..24fe30e4 100644 --- a/clearml/debugging/log.py +++ b/clearml/debugging/log.py @@ -20,6 +20,10 @@ class PickledLogger(logging.getLoggerClass()): @staticmethod def wrapper(a_instance, func, **kwargs): + # if python 3.7 and above Loggers are pickle-able + if sys.version_info.major >= 3 and sys.version_info.minor >= 7: + return a_instance + safe_logger = PickledLogger(name=kwargs.get('name')) safe_logger.__dict__ = a_instance.__dict__ if 'stream' in kwargs and kwargs['stream']: