1
0
mirror of https://sourceware.org/git/glibc.git synced 2025-07-30 22:43:12 +03:00

[benchtests] Fix compare_strings.py for python2

Python 2 does not have a FileNotFoundError so drop it in favour of
simply printing out the last (and most informative) line of the
exception.

	* benchtests/scripts/compare_strings.py: Import traceback.
	(parse_file): Pretty-print error.
This commit is contained in:
Siddhesh Poyarekar
2018-08-03 00:26:45 +05:30
parent 525691bde3
commit d67d634bef
2 changed files with 6 additions and 2 deletions

View File

@ -29,6 +29,7 @@ import os
import json
import pylab
import argparse
import traceback
try:
import jsonschema as validator
@ -45,8 +46,8 @@ def parse_file(filename, schema_filename):
bench = json.load(benchfile)
validator.validate(bench, schema)
return bench
except FileNotFoundError:
sys.stderr.write('Invalid input file %s.\n' % filename)
except:
print(traceback.format_exc(limit=1))
sys.exit(os.EX_NOINPUT)
def draw_graph(f, v, ifuncs, results):