]> arthur.barton.de Git - bup.git/commitdiff
lib/xstat: use // not / for int division for py3
authorJulien Goodwin <jgoodwin@studio442.com.au>
Thu, 30 Aug 2018 11:21:36 +0000 (21:21 +1000)
committerRob Browning <rlb@defaultvalue.org>
Mon, 3 Sep 2018 16:59:14 +0000 (11:59 -0500)
Adjust nsecs_to_timespec() and nsecs_to_timeval() to use // for
integer division for py3.

Signed-off-by: Julien Goodwin <jgoodwin@studio442.com.au>
[rlb@defaultvalue.org: adjust commit message]
Reviewed-by: Rob Browning <rlb@defaultvalue.org>
Tested-by: Rob Browning <rlb@defaultvalue.org>
lib/bup/xstat.py

index 3ba7b96cf74f7e37dccd41cdcc64b6aa48bef4df..cd71553e635548b9ea096e6c2a8991d3c011243e 100644 (file)
@@ -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):