Skip to content

Commit ccf1d71

Browse files
committed
Fix recursion on some systems
1 parent 633203a commit ccf1d71

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

adafruit_platformdetect/chip.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -422,6 +422,8 @@ def __getattr__(self, attr: str) -> bool:
422422
Detect whether the given attribute is the currently-detected chip. See
423423
list of constants at the top of this module for available options.
424424
"""
425+
if attr == "id":
426+
raise AttributeError() # Avoid infinite recursion
425427
if self.id == attr:
426428
return True
427429
return False

0 commit comments

Comments
 (0)