Core: Allow PlandoItems to be pickled (#5335)
* Add Options.PlandoItem * Remove worlds.generic.PlandoItem handling * Add plando pickling test * Revert old PlandoItem cleanup * Deprecate old PlandoItem * Change to warning message * Use deprecated decorator
This commit is contained in:
2
Utils.py
2
Utils.py
@@ -477,7 +477,7 @@ class RestrictedUnpickler(pickle.Unpickler):
|
||||
mod = importlib.import_module(module)
|
||||
obj = getattr(mod, name)
|
||||
if issubclass(obj, (self.options_module.Option, self.options_module.PlandoConnection,
|
||||
self.options_module.PlandoText)):
|
||||
self.options_module.PlandoItem, self.options_module.PlandoText)):
|
||||
return obj
|
||||
# Forbid everything else.
|
||||
raise pickle.UnpicklingError(f"global '{module}.{name}' is forbidden")
|
||||
|
||||
Reference in New Issue
Block a user