Skip to content

Commit

Permalink
ignore B902 blind except flake8 error
Browse files Browse the repository at this point in the history
  • Loading branch information
flynneva committed Jan 26, 2021
1 parent 341793b commit a3f648e
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 7 deletions.
4 changes: 2 additions & 2 deletions bno055/bno055.py
Expand Up @@ -101,7 +101,7 @@ def read_data():
try:
# perform synchronized block:
node.sensor.get_sensor_data()
except Exception as e:
except Exception as e: # noqa: B902
node.get_logger().warn('Receiving sensor data failed with %s:"%s"'
% (type(e).__name__, e))
finally:
Expand All @@ -121,7 +121,7 @@ def log_calibration_status():
try:
# perform synchronized block:
node.sensor.get_calib_status()
except Exception as e:
except Exception as e: # noqa: B902
node.get_logger().warn('Receiving calibration status failed with %s:"%s"'
% (type(e).__name__, e))
# traceback.print_exc()
Expand Down
4 changes: 2 additions & 2 deletions bno055/connectors/Connector.py
Expand Up @@ -61,7 +61,7 @@ def receive(self, reg_addr, length):
self.write(buf_out)
buf_in = bytearray(self.read(2 + length))
# print("Reading, wr: ", binascii.hexlify(buf_out), " re: ", binascii.hexlify(buf_in))
except Exception as e:
except Exception as e: # noqa: B902
# re-raise as IOError
raise TransmissionException('Transmission error: %s' % e)

Expand Down Expand Up @@ -122,7 +122,7 @@ def transmit(self, reg_addr, length, data: bytes):
self.write(buf_out)
buf_in = bytearray(self.read(2))
# print("Writing, wr: ", binascii.hexlify(buf_out), " re: ", binascii.hexlify(buf_in))
except Exception:
except Exception: # noqa: B902
return False

if (buf_in.__len__() != 2) or (buf_in[1] != 0x01):
Expand Down
2 changes: 1 addition & 1 deletion bno055/params/NodeParameters.py
Expand Up @@ -122,6 +122,6 @@ def __init__(self, node: Node):
self.gyr_offset = node.get_parameter('gyr_offset')
node.get_logger().info('\tgyr_offset:\t\t"%s"' % self.gyr_offset.value)

except Exception as e:
except Exception as e: # noqa: B902
node.get_logger().warn('Could not get parameters...setting variables to default')
node.get_logger().warn('Error: "%s"' % e)
4 changes: 2 additions & 2 deletions bno055/sensor/SensorService.py
Expand Up @@ -68,7 +68,7 @@ def configure(self):
if data[0] != registers.BNO055_ID:
raise IOError('Device ID=%s is incorrect' % data)
# print("device sent ", binascii.hexlify(data))
except Exception as e:
except Exception as e: # noqa: B902
# This is the first communication - exit if it does not work
self.node.get_logger().error('Communication error: %s' % e)
self.node.get_logger().error('Shutting down ROS node...')
Expand Down Expand Up @@ -300,5 +300,5 @@ def set_calib_offsets(self, acc_offset, mag_offset, gyr_offset):
self.con.transmit(registers.GYR_OFFSET + 4, 1, bytes([gyr_offset[2] & 0xFF]))
self.con.transmit(registers.GYR_OFFSET + 5, 1, bytes([(gyr_offset[2] >> 8) & 0xFF]))
return True
except Exception:
except Exception: # noqa: B902
return False

0 comments on commit a3f648e

Please sign in to comment.