Skip to content

Commit

Permalink
Merge pull request #383 from Theelx/main
Browse files Browse the repository at this point in the history
Add exception handling for missing class attributes
  • Loading branch information
Theelx committed May 3, 2022
2 parents b3c4ca2 + d5ba045 commit ff0c575
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion jsonpickle/unpickler.py
Expand Up @@ -715,7 +715,10 @@ def loadclass(module_and_name, classes=None):
__import__(module)
obj = sys.modules[module]
for class_name in names[up_to:]:
obj = getattr(obj, class_name)
try:
obj = getattr(obj, class_name)
except AttributeError:
continue
return obj
except (AttributeError, ImportError, ValueError):
continue
Expand Down

0 comments on commit ff0c575

Please sign in to comment.