瀏覽代碼

[Fix] #420 kill_switch os_exit to kill all process

ThiBuff 7 年之前
父節點
當前提交
c2c949435e
共有 2 個文件被更改,包括 3 次插入3 次删除
  1. 1 1
      kalliope/core/Models/Neuron.py
  2. 2 2
      kalliope/neurons/kill_switch/kill_switch.py

+ 1 - 1
kalliope/core/Models/Neuron.py

@@ -5,7 +5,7 @@ class Neuron(object):
     .. note:: Neurons are defined in the brain file
     """
 
-    def __init__(self, name=None, parameters=None):
+    def __init__(self, name=None, parameters=dict()):
         self.name = name
         self.parameters = parameters
 

+ 2 - 2
kalliope/neurons/kill_switch/kill_switch.py

@@ -1,4 +1,4 @@
-import sys
+import os
 
 from kalliope.core.NeuronModule import NeuronModule
 
@@ -9,4 +9,4 @@ class Kill_switch(NeuronModule):
     """
     def __init__(self, **kwargs):
         super(Kill_switch, self).__init__(**kwargs)
-        sys.exit()
+        os._exit(1)