Przeglądaj źródła

fix: cores/post_decorators

jingze_cheng 8 miesięcy temu
rodzic
commit
b886f8c9c9
1 zmienionych plików z 3 dodań i 1 usunięć
  1. 3 1
      cores/post_decorators.py

+ 3 - 1
cores/post_decorators.py

@@ -31,7 +31,9 @@ def rule2_decorator(f, *args, **kwargs):
     '''
     predict_line = args[1]
     predict_line = f(*args, **kwargs)
-    idx = predict_line.index('')
+    idx = 0
+    if '' in predict_line:
+        idx = predict_line.index('')
     try:
         if idx == 1:
             if '化合物' in predict_line[0]: