From: Noel Power Date: Fri, 27 Apr 2018 07:15:28 +0000 (+0100) Subject: python/samba: Py2/Py3 compat change '/' to '//' to ensure int result X-Git-Tag: ldb-1.4.0~503 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=268ad19eee469ef7d703d5b9610683aca874fa9f;p=thirdparty%2Fsamba.git python/samba: Py2/Py3 compat change '/' to '//' to ensure int result Signed-off-by: Noel Power Reviewed-by: Alexander Bokovoy Autobuild-User(master): Noel Power Autobuild-Date(master): Mon Apr 30 18:25:25 CEST 2018 on sn-devel-144 --- diff --git a/python/samba/graph.py b/python/samba/graph.py index 6cdd2ef77ed..7dfc19015e7 100644 --- a/python/samba/graph.py +++ b/python/samba/graph.py @@ -19,6 +19,7 @@ # along with this program. If not, see . from __future__ import print_function +from __future__ import division from samba import colour import sys @@ -39,8 +40,8 @@ def reformat_graph_label(s): if '-' in p[2:20]: q, p = p.split('-', 1) else: - n = len(p) / 12 - b = len(p) / n + n = len(p) // 12 + b = len(p) // n q, p = p[:b], p[b:] pieces.append(q + '-') if p: diff --git a/python/samba/netcmd/domain.py b/python/samba/netcmd/domain.py index d2dd06a3d48..1e242dea62e 100644 --- a/python/samba/netcmd/domain.py +++ b/python/samba/netcmd/domain.py @@ -23,6 +23,7 @@ # from __future__ import print_function +from __future__ import division import samba.getopt as options import ldb import string @@ -2331,7 +2332,7 @@ class cmd_domain_trust_create(DomainTrustCommand): # 512 bytes and a 2 bytes confounder is required. # def random_trust_secret(length): - pw = samba.generate_random_machine_password(length/2, length/2) + pw = samba.generate_random_machine_password(length//2, length//2) return string_to_byte_array(pw.encode('utf-16-le')) if local_trust_info.trust_direction & lsa.LSA_TRUST_DIRECTION_INBOUND: diff --git a/python/samba/upgradehelpers.py b/python/samba/upgradehelpers.py index e219602e0c7..d4f69445234 100644 --- a/python/samba/upgradehelpers.py +++ b/python/samba/upgradehelpers.py @@ -20,6 +20,7 @@ # along with this program. If not, see . from __future__ import print_function +from __future__ import division """Helpers used for upgrading between different database formats.""" import os @@ -725,7 +726,7 @@ def findprovisionrange(samdb, basedn): for o in obj.array: # like a timestamp but with the resolution of 1 minute - minutestamp =_glue.nttime2unix(o.originating_change_time)/60 + minutestamp =_glue.nttime2unix(o.originating_change_time) // 60 hash_ts = hash_id.get(str(o.originating_invocation_id)) if hash_ts is None: