sample_python_rpi_gpio.py 204 B

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