diff --git a/setHosts_Classic.py b/setHosts_Classic.py index af1b8fa..5cd3382 100644 --- a/setHosts_Classic.py +++ b/setHosts_Classic.py @@ -953,9 +953,9 @@ def write_to_hosts_file(self, new_entries: List[str]): # 非标记块内容保留 if ( - not skip - and (line.startswith("#") or not line) - and not any(tag in line for tag in skip_tags) + not skip and + (line.startswith("#") or not line) and + not any(tag in line for tag in skip_tags) ): new_content.append(line) continue @@ -974,7 +974,7 @@ def write_to_hosts_file(self, new_entries: List[str]): .replace("+0800", "+08:00") ) - rprint(f"\n[bold yellow]正在更新 hosts 文件...[/bold yellow]") + rprint("\n[bold yellow]正在更新 hosts 文件...[/bold yellow]") save_hosts_content = [] # 提取新内容文本