mirror of
https://github.com/ynput/ayon-core.git
synced 2025-12-24 21:04:40 +01:00
added few magic attributes to getattr
This commit is contained in:
parent
10dd583e4e
commit
c8b1037e99
1 changed files with 4 additions and 1 deletions
|
|
@ -48,7 +48,7 @@ class _ModuleClass(object):
|
|||
|
||||
def __getattr__(self, attr_name):
|
||||
if attr_name not in self.__attributes__:
|
||||
if attr_name in ("__path__"):
|
||||
if attr_name in ("__path__", "__file__"):
|
||||
return None
|
||||
raise ImportError("No module named {}.{}".format(
|
||||
self.name, attr_name
|
||||
|
|
@ -104,6 +104,9 @@ class _InterfacesClass(_ModuleClass):
|
|||
"""
|
||||
def __getattr__(self, attr_name):
|
||||
if attr_name not in self.__attributes__:
|
||||
if attr_name in ("__path__", "__file__"):
|
||||
return None
|
||||
|
||||
# Fake Interface if is not missing
|
||||
self.__attributes__[attr_name] = type(
|
||||
attr_name,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue