瀏覽代碼

[Fix] Fix bug when parameter are int

monf 8 年之前
父節點
當前提交
b3efbd0366
共有 1 個文件被更改,包括 3 次插入3 次删除
  1. 3 3
      kalliope/core/Utils/Utils.py

+ 3 - 3
kalliope/core/Utils/Utils.py

@@ -232,7 +232,7 @@ class Utils(object):
         # print "sentence to test %s" % sentence
         pattern = r"{{|}}"
         # prog = re.compile(pattern)
-        check_bool = re.search(pattern, sentence)
+        check_bool = re.search(pattern, str(sentence))
         if check_bool is not None:
             return True
         return False
@@ -247,7 +247,7 @@ class Utils(object):
 
         pattern = r"((?:{{\s*)[\w\.]+(?:\s*}}))"
         # find everything like {{ word }}
-        return re.findall(pattern, sentence)
+        return re.findall(pattern, str(sentence))
 
     @staticmethod
     def remove_spaces_in_brackets(sentence):
@@ -259,7 +259,7 @@ class Utils(object):
 
         pattern = '\s+(?=[^\{\{\}\}]*\}\})'
         # Remove white spaces (if any) between the variable and the double brace then split
-        return re.sub(pattern, '', sentence)
+        return re.sub(pattern, '', str(sentence))
 
     ##################
     #