Fix BrickRecordFields failing on KeyError instead of AttributeError when used with hasattr()

This commit is contained in:
Gregoo 2025-01-24 10:09:50 +01:00
parent 798226932f
commit b73bd6e99d

View File

@ -4,6 +4,9 @@ from typing import Any
# SQLite record fields # SQLite record fields
class BrickRecordFields(object): class BrickRecordFields(object):
def __getattr__(self, name: str, /) -> Any: def __getattr__(self, name: str, /) -> Any:
if name not in self.__dict__:
raise AttributeError(name)
return self.__dict__[name] return self.__dict__[name]
def __setattr__(self, name: str, value: Any, /) -> None: def __setattr__(self, name: str, value: Any, /) -> None: