typing和防炸

This commit is contained in:
UnCLAS-Prommer
2025-08-11 11:35:14 +08:00
parent 43190b12d2
commit 4cb57278b1
3 changed files with 88 additions and 106 deletions

View File

@@ -70,8 +70,8 @@ def get_key_comment(toml_table, key):
return item.trivia.comment
if hasattr(toml_table, "keys"):
for k in toml_table.keys():
if isinstance(k, KeyType) and k.key == key:
return k.trivia.comment
if isinstance(k, KeyType) and k.key == key: # type: ignore
return k.trivia.comment # type: ignore
return None