canfestival/canfestival.py
changeset 2459 21164625b393
parent 2442 b13f021c68a5
child 2736 a81b72ef156c
--- a/canfestival/canfestival.py	Fri Nov 23 11:01:20 2018 +0100
+++ b/canfestival/canfestival.py	Fri Nov 23 12:13:24 2018 +0100
@@ -24,6 +24,7 @@
 # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
 
 from __future__ import absolute_import
+from __future__ import division
 import os
 import sys
 import shutil
@@ -327,7 +328,7 @@
             nodeid = self.CanFestivalNode.getNodeId()
             if value != nodeid:
                 slaves = self.GetSlaveIDs()
-                dir = (value - nodeid) / abs(value - nodeid)
+                dir = (value - nodeid) // abs(value - nodeid)
                 while value in slaves and value >= 0:
                     value += dir
                 if value < 0:
@@ -616,6 +617,6 @@
         if can_driver is not None:
             can_driver_path = os.path.join(CanFestivalPath, "drivers", can_driver, can_driver_name)
             if os.path.exists(can_driver_path):
-                res += ((can_driver_name, file(can_driver_path, "rb")),)
+                res += ((can_driver_name, open(can_driver_path, "rb")),)
 
         return res