From d970af73fd1878b26622dec426d569e7a6f613b5 Mon Sep 17 00:00:00 2001 From: Andrew Scheller Date: Thu, 18 Feb 2016 18:53:52 +0000 Subject: [PATCH] Catch AttributeError inside GPIODevice._read Fixes #202 --- gpiozero/devices.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gpiozero/devices.py b/gpiozero/devices.py index a1feb4e..5e5b29b 100644 --- a/gpiozero/devices.py +++ b/gpiozero/devices.py @@ -243,7 +243,7 @@ class GPIODevice(ValuesMixin, GPIOBase): def _read(self): try: return self.pin.state == self._active_state - except TypeError: + except (AttributeError, TypeError): self._check_open() raise