Skip to content

Commit

Permalink
Fix for recursion error when pickling (#918)
Browse files Browse the repository at this point in the history
  • Loading branch information
tcbegley authored Dec 28, 2022
1 parent 2bd7064 commit 59c1dcb
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions dash_bootstrap_components/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,12 @@ def __getattr__(self, name):
)
return getattr(self.wrapped, name)

def __setstate__(self, state):
# ensure deprecated & wrapped fields are set to avoid recursive stack
# explosion in __getattr__
self.deprecated = state.get("deprecated", None)
self.wrapped = state.get("wrapped", None)

def __dir__(self):
# required for autocomplete. filter out os, and sys imports
return [
Expand Down

0 comments on commit 59c1dcb

Please # to comment.