From 6acbb4d025af9c4c0b9dd207c230caf688d9e812 Mon Sep 17 00:00:00 2001 From: Julien Goodwin Date: Thu, 30 Aug 2018 21:21:36 +1000 Subject: [PATCH] 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 --- lib/bup/xstat.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) 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): -- 2.39.2