about summary refs log tree commit diff
path: root/benchtests/scripts/compare_strings.py
diff options
context:
space:
mode:
authorSiddhesh Poyarekar <siddhesh@sourceware.org>2018-08-03 00:26:45 +0530
committerSiddhesh Poyarekar <siddhesh@sourceware.org>2018-08-03 00:26:45 +0530
commitd67d634bef4deda775b9e6ee74ed1807963caf35 (patch)
tree8bc96b9572a2d9e7f0c4f46cdd3e22f70507cb44 /benchtests/scripts/compare_strings.py
parent525691bde3b574c4a1800c510db0dd85a70fd9c5 (diff)
downloadglibc-d67d634bef4deda775b9e6ee74ed1807963caf35.tar.gz
glibc-d67d634bef4deda775b9e6ee74ed1807963caf35.tar.xz
glibc-d67d634bef4deda775b9e6ee74ed1807963caf35.zip
[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.
Diffstat (limited to 'benchtests/scripts/compare_strings.py')
-rwxr-xr-xbenchtests/scripts/compare_strings.py5
1 files changed, 3 insertions, 2 deletions
diff --git a/benchtests/scripts/compare_strings.py b/benchtests/scripts/compare_strings.py
index e3ad8ff058..78e508fd91 100755
--- a/benchtests/scripts/compare_strings.py
+++ b/benchtests/scripts/compare_strings.py
@@ -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):