From 03c57accfd013e48614e361d11fc44edbdad3e5d Mon Sep 17 00:00:00 2001 From: wulan17 Date: Mon, 8 Dec 2025 03:05:00 +0700 Subject: [PATCH] pyrofork: access class __annotations__ instead of instance Python 3.14 removed implicit fallback to class-level __annotations__, causing AttributeError when accessing self.__annotations__. Updated matches() to use self.__class__.__annotations__ for compatibility across Python 3.10+. Signed-off-by: wulan17 --- pyrogram/types/pyromod/identifier.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pyrogram/types/pyromod/identifier.py b/pyrogram/types/pyromod/identifier.py index 17be0478..4f7babf1 100644 --- a/pyrogram/types/pyromod/identifier.py +++ b/pyrogram/types/pyromod/identifier.py @@ -46,7 +46,7 @@ class Identifier: # Compare each property of other with the corresponding property in self # If the property in self is None, the property in other can be anything # If the property in self is not None, the property in other must be the same - for field in self.__annotations__: + for field in self.__class__.__annotations__: pattern_value = getattr(self, field) update_value = getattr(update, field) @@ -67,7 +67,7 @@ class Identifier: def count_populated(self): non_null_count = 0 - for attr in self.__annotations__: + for attr in self.__class__.__annotations__: if getattr(self, attr) is not None: non_null_count += 1