1try: 2 import RPi.GPIO # noqa 3except RuntimeError as e: 4 assert(str(e) == 'This module can only be run on a Raspberry Pi!') 5else: 6 raise RuntimeError('Import succeeded when it should not have!') 7