Skip to content

Commit 1e279fc

Browse files
authored
Merge pull request #31 from makermelissa/main
Account for Python 3.14 returning BlockingIOError instead of TypeError
2 parents c986895 + 3d7ee14 commit 1e279fc

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

adafruit_shell.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,7 @@ def read_stream(output):
115115
fcntl.fcntl(file_descriptor, fcntl.F_SETFL, file_flags | os.O_NONBLOCK)
116116
try:
117117
return output.read()
118-
except TypeError:
118+
except (TypeError, BlockingIOError):
119119
return ""
120120

121121
# Allow running as a different user if we are root
@@ -640,11 +640,11 @@ def get_os(self):
640640
release = opsys
641641
if release == "Debian" and os.path.exists("/etc/rpi-issue"):
642642
release = "Raspbian"
643-
if os.path.isdir(os.path.expanduser("~/.kano-settings")) or os.path.isdir(
644-
os.path.expanduser("~/.kanoprofile")
645-
):
643+
if self.isdir("/etc/pi-top") or self.isdir("~/.config/pi-top"):
644+
release = "PiTop"
645+
if self.isdir("~/.kano-settings") or self.isdir("~/.kanoprofile"):
646646
release = "Kano"
647-
if os.path.isdir(os.path.expanduser("~/.config/ubuntu-mate")):
647+
if self.isdir("~/.config/ubuntu-mate"):
648648
release = "Mate"
649649
if platform.system() == "Darwin":
650650
release = "Darwin"

0 commit comments

Comments
 (0)