fix(sendmsg): 修复文件路径检查逻辑
- 合并文件路径和文件存在性检查为单一条件,确保在文件路径有效时才进行后续操作。
This commit is contained in:
parent
462fed6336
commit
08d302b22c
@ -90,8 +90,7 @@ def send_daily_message(count):
|
||||
print(f"找到了{format}格式的图片文件!")
|
||||
break
|
||||
|
||||
if file_path:
|
||||
if os.path.isfile(file_path):
|
||||
if file_path and os.path.isfile(file_path):
|
||||
logger.info("找到了指定文件!")
|
||||
logger.info(f"文件大小: {os.path.getsize(file_path)} 字节")
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user