Skip to content

Commit

Permalink
Merge pull request #7 from ken-morel/dev
Browse files Browse the repository at this point in the history
fixed issue with multiple self when using with pyoload
  • Loading branch information
ken-morel authored Jul 31, 2024
2 parents e6d832f + 65cd19b commit 2afaa48
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions src/comberload.py
Original file line number Diff line number Diff line change
Expand Up @@ -101,14 +101,16 @@ def failback(self, func: Callable):
self._fallback = func
return func

def __call__(self, *args, **kw):
def __call__(__comberloaded_special__self, *args, **kw):
"""
calls callback or function depending on if loading complete
"""
if hasattr(self, "__self__"):
return self.call(self.__self__, *args, **kw)
if hasattr(__comberloaded_special__self, "__self__"):
return __comberloaded_special__self.call(
__comberloaded_special__self.__self__, *args, **kw
)
else:
return self.call(*args, **kw)
return __comberloaded_special__self.call(*args, **kw)

def __get__(self, instance, *__, **_):
"""
Expand Down

0 comments on commit 2afaa48

Please sign in to comment.