Skip to content

Commit

Permalink
修复漫巡可能会卡住的问题
Browse files Browse the repository at this point in the history
  • Loading branch information
ok-oldking committed Jul 16, 2024
1 parent b8764af commit 6e01cd0
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion task/NewManXunTask.py
Original file line number Diff line number Diff line change
Expand Up @@ -641,8 +641,12 @@ def target_index_array(lst):
def remove_non_digits_and_convert(s):
# Use regular expression to keep only digits and '+' characters
clean_string = re.sub(r'[^0-9+]', '', s)
clean_string = clean_string.strip('+')
# Evaluate the cleaned string as a mathematical expression
return eval(clean_string)
try:
return eval(clean_string)
except Exception as e:
return 0


gray_percent_per_line = 0.03660270078 * 100
Expand Down

0 comments on commit 6e01cd0

Please sign in to comment.