Skip to content

Commit

Permalink
catch rpi.gpio import error
Browse files Browse the repository at this point in the history
  • Loading branch information
thijstriemstra committed Mar 8, 2017
1 parent 95c2812 commit 342eff1
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion luma/core/lib.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,8 @@ def __rpi_gpio__(self):
import RPi.GPIO
return RPi.GPIO
except RuntimeError as e:
if str(e) == 'This module can only be run on a Raspberry Pi!':
if str(e) in ['This module can only be run on a Raspberry Pi!',
'Module not imported correctly!']:
raise luma.core.error.UnsupportedPlatform(
'GPIO access not available')

Expand Down

0 comments on commit 342eff1

Please sign in to comment.