From 8e57433d390434ef37defd6b667e932144b638ee Mon Sep 17 00:00:00 2001 From: JarbasAi Date: Fri, 29 Dec 2023 17:46:09 +0000 Subject: [PATCH] restore exception if string does not end in .intent --- ovos_workshop/skills/ovos.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/ovos_workshop/skills/ovos.py b/ovos_workshop/skills/ovos.py index abd02718..57648066 100644 --- a/ovos_workshop/skills/ovos.py +++ b/ovos_workshop/skills/ovos.py @@ -1230,8 +1230,9 @@ def register_intent(self, intent_parser: Union[IntentBuilder, Intent, str], file to parse utterance for the handler. handler (func): function to register with intent """ - if (isinstance(intent_parser, str) and - intent_parser.endswith('.intent')): + if isinstance(intent_parser, str): + if not intent_parser.endswith('.intent'): + raise ValueError return self.register_intent_file(intent_parser, handler) return self._register_adapt_intent(intent_parser, handler)