Skip to content

Commit

Permalink
fix: adding to globals in a package doesn't work, so just print tip i…
Browse files Browse the repository at this point in the history
…nstead
  • Loading branch information
robinvandernoord committed Nov 17, 2023
1 parent e956f4e commit b5b037a
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/verysimpletransformers/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -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 <class '__main__.{clsname}'>: attribute lookup {clsname} on __main__ failed`",
file=sys.stderr,
)

return model, metadata, meta_check_passed
except BaseVSTException:
Expand Down

0 comments on commit b5b037a

Please sign in to comment.