changeset 28073:c4bec3c45ec9

revsetbenchmark: handle exception case If the revset being benchmarked has an exception, the handling code was encountering an error because the exception did not always have an "output" attribute (I think it's a python 2.7 thing).
author Durham Goode <durham@fb.com>
date Wed, 10 Feb 2016 12:39:25 -0800
parents c3e9269d9602
children a1924bc6e267
files contrib/revsetbenchmarks.py
diffstat 1 files changed, 1 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/contrib/revsetbenchmarks.py	Wed Feb 10 09:06:08 2016 -0800
+++ b/contrib/revsetbenchmarks.py	Wed Feb 10 12:39:25 2016 -0800
@@ -63,7 +63,7 @@
         return parseoutput(output)
     except CalledProcessError as exc:
         print >> sys.stderr, 'abort: cannot run revset benchmark: %s' % exc.cmd
-        if exc.output is None:
+        if getattr(exc, 'output', None) is None: # no output before 2.7
             print >> sys.stderr, '(no output)'
         else:
             print >> sys.stderr, exc.output