Skip to content
This repository has been archived by the owner on Sep 20, 2024. It is now read-only.

Commit

Permalink
Merge pull request #2855 from pypeclub/bugfix/geattr_on_dynamic_module
Browse files Browse the repository at this point in the history
General: Fix getattr clalback on dynamic modules
  • Loading branch information
iLLiCiTiT authored Mar 10, 2022
2 parents 765cbc4 + ee71d3b commit 2f0985d
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion openpype/modules/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@ class _ModuleClass(object):
def __init__(self, name):
# Call setattr on super class
super(_ModuleClass, self).__setattr__("name", name)
super(_ModuleClass, self).__setattr__("__name__", name)

# Where modules and interfaces are stored
super(_ModuleClass, self).__setattr__("__attributes__", dict())
Expand All @@ -72,7 +73,7 @@ def __getattr__(self, attr_name):
if attr_name not in self.__attributes__:
if attr_name in ("__path__", "__file__"):
return None
raise ImportError("No module named {}.{}".format(
raise AttributeError("'{}' has not attribute '{}'".format(
self.name, attr_name
))
return self.__attributes__[attr_name]
Expand Down

0 comments on commit 2f0985d

Please sign in to comment.