Fix incorrect porcupine shutdown and Exception
Flagged by flake8 after merge
@@ -315,7 +315,7 @@ class PorcupineHotWord(HotWordEngine):
sys.path.append(bindings_path)
try:
from porcupine import Porcupine
- except ModuleNotFoundError:
+ except ImportError:
raise Exception(
"Python bindings for Porcupine not found. "
"Please use --porcupine-path to set Porcupine base path")
@@ -370,7 +370,7 @@ class PorcupineHotWord(HotWordEngine):
def stop(self):
if self.porcupine is not None:
- porcupine.delete()
+ self.porcupine.delete()
class HotWordFactory:
