mirror of
https://github.com/clearml/clearml
synced 2025-03-03 18:52:12 +00:00
Fix internal logging.Logger pickle fix (only applies to py <= 3.6)
This commit is contained in:
parent
88168f9ee4
commit
41d6c24e9f
@ -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']:
|
||||
|
Loading…
Reference in New Issue
Block a user