From b5b037a12f65e2f2fbd4e320a33946a15e00a695 Mon Sep 17 00:00:00 2001 From: Robin van der Noord Date: Fri, 17 Nov 2023 12:10:55 +0100 Subject: [PATCH] fix: adding to globals in a package doesn't work, so just print tip instead --- src/verysimpletransformers/core.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/verysimpletransformers/core.py b/src/verysimpletransformers/core.py index 1f0cdf6..be5a40d 100644 --- a/src/verysimpletransformers/core.py +++ b/src/verysimpletransformers/core.py @@ -287,8 +287,11 @@ def _from_vst( cls = model.__class__ clsname = cls.__name__ - if clsname not in globals(): - globals()[clsname] = cls + print( + f"Tip: run `{clsname} = model.__class__` if you get an error like " + f"`Can't pickle : attribute lookup {clsname} on __main__ failed`", + file=sys.stderr, + ) return model, metadata, meta_check_passed except BaseVSTException: