提交 c53f5e6b 编写于 作者: M MRXLT

bug fix

上级 4f2e6572
......@@ -23,7 +23,11 @@ def update_info(file_name, feature, info):
with open(file_name, "r") as f:
for line in f.readlines():
if re.match(feature, line):
line = feature + " = \"" + info.decode('utf-8').strip() + "\"\n"
if isinstance(info, str):
line = feature + " = \"" + info.strip() + "\"\n"
else:
line = feature + " = \"" + info.decode('utf-8').strip(
) + "\"\n"
new_str = new_str + line
with open(file_name, "w") as f:
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册