Skip to content
Snippets Groups Projects
Commit 292371f7 authored by cclauss's avatar cclauss
Browse files

Old style exceptions --> new stye for Python 3

parent bbaff880
Branches
No related tags found
No related merge requests found
......@@ -459,7 +459,7 @@ class CommanderTCPHandler(SocketServer.BaseRequestHandler):
if not buf:
buf = buf + self.recv_more()
except EOF, ex:
except EOF as ex:
print("Connection closed (command):", ex)
setConnectedRobot(None)
......@@ -964,7 +964,7 @@ def main():
prevent_programming = rospy.get_param("~prevent_programming")
update = {'prevent_programming': prevent_programming}
reconfigure_srv.update_configuration(update)
except KeyError, ex:
except KeyError as ex:
print("Parameter 'prevent_programming' not set. Value: " + str(prevent_programming))
pass
if prevent_programming:
......@@ -985,7 +985,7 @@ def main():
prevent_programming = rospy.get_param("~prevent_programming")
update = {'prevent_programming': prevent_programming}
reconfigure_srv.update_configuration(update)
except KeyError, ex:
except KeyError as ex:
print("Parameter 'prevent_programming' not set. Value: " + str(prevent_programming))
pass
connection.send_program()
......
......@@ -21,25 +21,25 @@ ANALOG_TOLERANCE_VALUE = 0.01
def set_io_val(fun, pin, val):
try:
set_io(fun, pin, val)
except rospy.ServiceException, e:
except rospy.ServiceException as e:
print "Service call failed: %s"%e
def set_tool_voltage(volts):
try:
set_io(FUN_SET_TOOL_VOLTAGE, volts, 0)
except rospy.ServiceException, e:
except rospy.ServiceException as e:
print "Service call failed: %s"%e
def set_digital_out(pin, val):
try:
set_io(FUN_SET_DIGITAL_OUT, pin, val)
except rospy.ServiceException, e:
except rospy.ServiceException as e:
print "Service call failed: %s"%e
def set_analog_out(pin, val):
try:
set_io(FUN_SET_ANALOG_OUT, pin, val)
except rospy.ServiceException, e:
except rospy.ServiceException as e:
print "Service call failed: %s"%e
def set_flag(pin, val):
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment