Remove duplicate getattr call in entity wrap_attr (#118558)

pull/118512/head
J. Nick Koston 2024-05-31 10:11:46 -05:00 committed by GitHub
parent 6dd01dbff7
commit ade0f94a20
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 1 additions and 1 deletions

View File

@ -365,7 +365,7 @@ class CachedProperties(type):
attr = getattr(cls, attr_name)
if isinstance(attr, (FunctionType, property)):
raise TypeError(f"Can't override {attr_name} in subclass")
setattr(cls, private_attr_name, getattr(cls, attr_name))
setattr(cls, private_attr_name, attr)
annotations = cls.__annotations__
if attr_name in annotations:
annotations[private_attr_name] = annotations.pop(attr_name)