Skip to content

Commit 4e180f0

Browse files
fix: __class__ attribute of env is accessed by readthedocks and should not crash
Signed-off-by: thiswillbeyourgithub <[email protected]>
1 parent 243de66 commit 4e180f0

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

wdoc/utils/env.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -190,8 +190,12 @@ def __getattribute__(self, name):
190190
"__warned_unexpected__",
191191
"__check_unexpected_vars__",
192192
"__doc__",
193+
"__class__",
193194
]:
194195
return super().__getattribute__(name)
196+
elif name.startswith("__") and name.ends_with("__"):
197+
logger.debug(f"Unexpected attribute of EnvDataclass was accessed: '{name}'")
198+
return super().__getattribute__(name)
195199
self.__check_unexpected_vars__()
196200

197201
# get the current value stored in the dataclass

0 commit comments

Comments
 (0)