Skip to content

Commit bac4ba3

Browse files
author
marcusw
committed
Accidentally included the DirProtError change in the last rev. Reverting to keep my planned merge to the v2.0 branch possible.
1 parent 02e2d23 commit bac4ba3

1 file changed

Lines changed: 3 additions & 9 deletions

File tree

nxt/sensor/digital.py

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# nxt.sensor module -- Classes to read LEGO Mindstorms NXT sensors
22
# Copyright (C) 2006,2007 Douglas P Lau
33
# Copyright (C) 2009 Marcus Wanner, Paulo Vieira, rhn
4-
# Copyright (C) 2010,2011 Marcus Wanner
4+
# Copyright (C) 2010 Marcus Wanner
55
#
66
# This program is free software: you can redistribute it and/or modify
77
# it under the terms of the GNU General Public License as published by
@@ -13,7 +13,7 @@
1313
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
1414
# GNU General Public License for more details.
1515

16-
from nxt.error import I2CError, I2CPendingError, DirProtError
16+
from nxt.error import I2CError, I2CPendingError
1717

1818
from common import *
1919
from time import sleep, time
@@ -128,13 +128,7 @@ def read_value(self, name):
128128
tuples containing only one element.
129129
"""
130130
address, fmt = self.I2C_ADDRESS[name]
131-
for n in range(3):
132-
try:
133-
return self._i2c_query(address, fmt)
134-
except DirProtError:
135-
print "DEBUG: DirProtError averted!"
136-
pass
137-
raise I2CError, "read_value timeout"
131+
return self._i2c_query(address, fmt)
138132

139133
def write_value(self, name, value):
140134
"""Writes value to the sensor. Name must be a string found in

0 commit comments

Comments
 (0)