Skip to content

Commit

Permalink
fix isinstance checks
Browse files Browse the repository at this point in the history
  • Loading branch information
JarbasAl committed Sep 19, 2023
1 parent c0a775f commit 2aff7fc
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
6 changes: 4 additions & 2 deletions ovos_workshop/skills/mycroft_skill.py
Original file line number Diff line number Diff line change
Expand Up @@ -113,10 +113,12 @@ def __instancecheck__(self, instance):
if is_classic_core():
# instance imported from vanilla mycroft
from mycroft.skills import MycroftSkill as _CoreSkill
if issubclass(self.__class__, _CoreSkill):
if issubclass(instance.__class__, _CoreSkill):
return True

return super().__instancecheck__(instance)
from ovos_workshop.skills.ovos import OVOSSkill
return super().__instancecheck__(instance) or \
issubclass(instance.__class__, OVOSSkill)


class MycroftSkill(BaseSkill, metaclass=_SkillMetaclass):
Expand Down
2 changes: 1 addition & 1 deletion ovos_workshop/skills/ovos.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ def __instancecheck__(self, instance):
return True

return super().__instancecheck__(instance) or \
issubclass(self.__class__, MycroftSkill)
issubclass(instance.__class__, MycroftSkill)


class OVOSSkill(BaseSkill, metaclass=_OVOSSkillMetaclass):
Expand Down

0 comments on commit 2aff7fc

Please sign in to comment.