diff --git a/palladium-monitor/app.py b/palladium-monitor/app.py index e20dadd..362d76d 100644 --- a/palladium-monitor/app.py +++ b/palladium-monitor/app.py @@ -10,6 +10,8 @@ Palladium Z1 Monitor — LD逻辑板使用监控系统 2. API 推送 — 在 Palladium 主机运行 collect.py 远程推送 """ +from __future__ import annotations # PEP 563: 兼容 Python 3.7+ (避免 PEP 585 泛型语法) + import os import re import io diff --git a/palladium-monitor/mailer.py b/palladium-monitor/mailer.py index b0c7c65..f817ff1 100644 --- a/palladium-monitor/mailer.py +++ b/palladium-monitor/mailer.py @@ -5,6 +5,8 @@ mailer.py — Palladium Z1 每日报告邮件发送 所有配置都从环境变量读 (生产建议用 systemd EnvironmentFile 或 .env)。 """ +from __future__ import annotations # PEP 563: 让所有 type hint 变字符串, 兼容 Python 3.7+ + import os import smtplib import socket