aboutsummaryrefslogtreecommitdiff
path: root/tools
diff options
context:
space:
mode:
Diffstat (limited to 'tools')
-rw-r--r--tools/CoqMakefile.in6
-rw-r--r--tools/TimeFileMaker.py14
2 files changed, 13 insertions, 7 deletions
diff --git a/tools/CoqMakefile.in b/tools/CoqMakefile.in
index 872a732824..8b6822a4ed 100644
--- a/tools/CoqMakefile.in
+++ b/tools/CoqMakefile.in
@@ -90,9 +90,9 @@ COQDOC ?= "$(COQBIN)coqdoc"
COQMKFILE ?= "$(COQBIN)coq_makefile"
# Timing scripts
-COQMAKE_ONE_TIME_FILE ?= PYTHONIOENCODING=UTF-8 "$(COQLIB)/tools/make-one-time-file.py"
-COQMAKE_BOTH_TIME_FILES ?= PYTHONIOENCODING=UTF-8 "$(COQLIB)/tools/make-both-time-files.py"
-COQMAKE_BOTH_SINGLE_TIMING_FILES ?= PYTHONIOENCODING=UTF-8 "$(COQLIB)/tools/make-both-single-timing-files.py"
+COQMAKE_ONE_TIME_FILE ?= "$(COQLIB)/tools/make-one-time-file.py"
+COQMAKE_BOTH_TIME_FILES ?= "$(COQLIB)/tools/make-both-time-files.py"
+COQMAKE_BOTH_SINGLE_TIMING_FILES ?= "$(COQLIB)/tools/make-both-single-timing-files.py"
BEFORE ?=
AFTER ?=
diff --git a/tools/TimeFileMaker.py b/tools/TimeFileMaker.py
index ad001012a3..8564aeff64 100644
--- a/tools/TimeFileMaker.py
+++ b/tools/TimeFileMaker.py
@@ -1,6 +1,7 @@
from __future__ import with_statement
from __future__ import division
from __future__ import unicode_literals
+from __future__ import print_function
import os, sys, re
from io import open
@@ -144,13 +145,14 @@ def make_diff_table_string(left_times_dict, right_times_dict,
for name, lseconds, rseconds in prediff_times)
# update to sort by approximate difference, first
get_key_abs = make_sorting_key(all_names_dict, descending=descending)
- get_key_diff = (lambda name: fix_sign_for_sorting(int(abs(to_seconds(diff_times_dict[name]))), descending=descending))
+ get_key_diff_float = (lambda name: fix_sign_for_sorting(to_seconds(diff_times_dict[name]), descending=descending))
+ get_key_diff_absint = (lambda name: fix_sign_for_sorting(int(abs(to_seconds(diff_times_dict[name]))), descending=descending))
if sort_by == 'absolute':
get_key = get_key_abs
elif sort_by == 'diff':
- get_key = get_key_diff
+ get_key = get_key_diff_float
else: # sort_by == 'auto'
- get_key = (lambda name: (get_key_diff(name), get_key_abs(name)))
+ get_key = (lambda name: (get_key_diff_absint(name), get_key_abs(name)))
names = sorted(all_names_dict.keys(), key=get_key)
#names = get_sorted_file_list_from_times_dict(all_names_dict, descending=descending)
# set the widths of each of the columns by the longest thing to go in that column
@@ -206,7 +208,11 @@ def make_table_string(times_dict,
def print_or_write_table(table, files):
if len(files) == 0 or '-' in files:
- print(table)
+ try:
+ binary_stdout = sys.stdout.buffer
+ except AttributeError:
+ binary_stdout = sys.stdout
+ print(table.encode("utf-8"), file=binary_stdout)
for file_name in files:
if file_name != '-':
with open(file_name, 'w', encoding="utf-8") as f: