Skip to content

Commit a46ba23

Browse files
authored
Merge pull request #315 from makermelissa/recursion-fix
Fix recursion on some systems
2 parents 659af73 + 89849d4 commit a46ba23

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)