graph: fix divide for py3
authorJoe Guo <joeg@catalyst.net.nz>
Tue, 10 Apr 2018 03:48:35 +0000 (15:48 +1200)
committerDouglas Bagnall <dbagnall@samba.org>
Fri, 13 Apr 2018 05:27:13 +0000 (07:27 +0200)
`/` will return float other than int in py3.
Use `//` to keep consistent with py2.

Signed-off-by: Joe Guo <joeg@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
python/samba/graph.py

index 3b8f61194f4ca0d6cc7e68416b268c57b87f1833..6cdd2ef77ed67c020234345b116f5ac6f0fc8cd8 100644 (file)
@@ -497,7 +497,7 @@ def get_transitive_colourer(colours, n_vertices):
         n = 1 + int(n_vertices ** 0.5)
 
         def f(link):
-            return scale[min(link * m / n, m - 1)]
+            return scale[min(link * m // n, m - 1)]
 
     else:
         def f(link):