perf-glance: make compatible with python==python3
authorJohannes Berg <johannes@sipsolutions.net>
Sat, 8 Feb 2020 20:10:58 +0000 (21:10 +0100)
committerRob Browning <rlb@defaultvalue.org>
Sun, 9 Feb 2020 04:09:52 +0000 (22:09 -0600)
If python is python3, then print is a function. Fix the code
to make it a function since python2 doesn't really care (in
this particular case where we just have a single argument).

Signed-off-by: Johannes Berg <johannes@sipsolutions.net>
Tested-by: Rob Browning <rlb@defaultvalue.org>
t/perf-glance

index 5877c626764d1c155b3841cbc81fd442e4619310..55ae966f3e2dcdeb3f51d71acd03f47b8b2cb65d 100755 (executable)
@@ -24,7 +24,7 @@ bup()
 
 get-time()
 {
-    python -c 'import time; print time.time()'
+    python -c 'import time; print(time.time())'
 }
 
 rm -rf "$BUP_DIR"
@@ -53,11 +53,11 @@ all_finish="$(get-time)"
 set +x
 cat <<EOS
 
-init: $(python -c "print $init_finish - $init_start")
-index: $(python -c "print $index_finish - $index_start")
-save: $(python -c "print $save_finish - $save_start")
-restore: $(python -c "print $restore_finish - $restore_start")
-all: $(python -c "print $all_finish - $all_start")
+init: $(python -c "print($init_finish - $init_start)")
+index: $(python -c "print($index_finish - $index_start)")
+save: $(python -c "print($save_finish - $save_start)")
+restore: $(python -c "print($restore_finish - $restore_start)")
+all: $(python -c "print($all_finish - $all_start)")
 EOS
 
 cd "$top"