Skip to content

Commit c4bb932

Browse files
authored
Merge pull request #63 from BiffoBear/add-0x-to-error-msg
Added 0x prefix to i2c addr in "No I2C device at address:" err msg.
2 parents eb4b21e + 9baddca commit c4bb932

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

adafruit_bus_device/i2c_device.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -177,6 +177,8 @@ def __probe_for_device(self):
177177
result = bytearray(1)
178178
self.i2c.readfrom_into(self.device_address, result)
179179
except OSError:
180-
raise ValueError("No I2C device at address: %x" % self.device_address)
180+
# pylint: disable=raise-missing-from
181+
raise ValueError("No I2C device at address: 0x%x" % self.device_address)
182+
# pylint: enable=raise-missing-from
181183
finally:
182184
self.i2c.unlock()

0 commit comments

Comments
 (0)