From: Julien Goodwin Date: Thu, 30 Aug 2018 11:21:36 +0000 (+1000) Subject: lib/xstat: use // not / for int division for py3 X-Git-Tag: 0.30~52 X-Git-Url: https://arthur.barton.de/gitweb/?p=bup.git;a=commitdiff_plain;h=6acbb4d025af9c4c0b9dd207c230caf688d9e812 lib/xstat: use // not / for int division for py3 Adjust nsecs_to_timespec() and nsecs_to_timeval() to use // for integer division for py3. Signed-off-by: Julien Goodwin [rlb@defaultvalue.org: adjust commit message] Reviewed-by: Rob Browning Tested-by: Rob Browning --- diff --git a/lib/bup/xstat.py b/lib/bup/xstat.py index 3ba7b96..cd71553 100644 --- a/lib/bup/xstat.py +++ b/lib/bup/xstat.py @@ -30,19 +30,19 @@ def nsecs_to_timespec(ns): """Return (s, ns) where ns is always non-negative and t = s + ns / 10e8""" # metadata record rep ns = int(ns) - return (ns / 10**9, ns % 10**9) + return (ns // 10**9, ns % 10**9) def nsecs_to_timeval(ns): """Return (s, us) where ns is always non-negative and t = s + us / 10e5""" ns = int(ns) - return (ns / 10**9, (ns % 10**9) / 1000) + return (ns // 10**9, (ns % 10**9) // 1000) def fstime_floor_secs(ns): """Return largest integer not greater than ns / 10e8.""" - return int(ns) / 10**9; + return int(ns) // 10**9; def fstime_to_timespec(ns):