Skip to content

Commit

Permalink
Merge pull request #315 from makermelissa/recursion-fix
Browse files Browse the repository at this point in the history
Fix recursion on some systems
  • Loading branch information
kattni committed Sep 18, 2023
2 parents 659af73 + 89849d4 commit a46ba23
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions adafruit_platformdetect/chip.py
Original file line number Diff line number Diff line change
Expand Up @@ -422,6 +422,8 @@ def __getattr__(self, attr: str) -> bool:
Detect whether the given attribute is the currently-detected chip. See
list of constants at the top of this module for available options.
"""
if attr == "id":
raise AttributeError() # Avoid infinite recursion
if self.id == attr:
return True
return False

0 comments on commit a46ba23

Please sign in to comment.