Skip to content

Commit 60164d1

Browse files
committed
Fix annotation lookup for Python 3.14
1 parent bca376a commit 60164d1

2 files changed

Lines changed: 3 additions & 3 deletions

File tree

pgfutils.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -459,14 +459,14 @@ def update(self, new_settings: Mapping[str, Mapping[str, Any]]):
459459
460460
"""
461461
# Check if there are sections we don't use.
462-
extra = set(new_settings.keys()).difference(self.__annotations__)
462+
extra = set(new_settings.keys()).difference(Config.__annotations__)
463463
if extra:
464464
warnings.warn(
465465
f"unknown sections in configuration: {', '.join(extra)}", stacklevel=2
466466
)
467467

468468
# Process each section we know about.
469-
for name, definition in self.__annotations__.items():
469+
for name, definition in Config.__annotations__.items():
470470
if name not in new_settings:
471471
continue
472472

tests/test_data.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ def test_data_config(self):
1818
# Helper function to convert a config object to a dictionary.
1919
def to_dict(cfg: Config):
2020
result = {}
21-
for section in cfg.__annotations__.keys():
21+
for section in Config.__annotations__.keys():
2222
result[section] = getattr(cfg, section)
2323
return result
2424

0 commit comments

Comments
 (0)