Fix ansible-test encoding issues for exceptions.

pull/46364/head
Matt Clay 6 years ago
parent e53390b3b1
commit 0d7a156319

@ -91,10 +91,10 @@ def main():
display.review_warnings() display.review_warnings()
except ApplicationWarning as ex: except ApplicationWarning as ex:
display.warning(str(ex)) display.warning(u'%s' % ex)
exit(0) exit(0)
except ApplicationError as ex: except ApplicationError as ex:
display.error(str(ex)) display.error(u'%s' % ex)
exit(1) exit(1)
except KeyboardInterrupt: except KeyboardInterrupt:
exit(2) exit(2)

@ -76,7 +76,7 @@ def command_coverage_combine(args):
try: try:
original.read_file(coverage_file) original.read_file(coverage_file)
except Exception as ex: # pylint: disable=locally-disabled, broad-except except Exception as ex: # pylint: disable=locally-disabled, broad-except
display.error(str(ex)) display.error(u'%s' % ex)
continue continue
for filename in original.measured_files(): for filename in original.measured_files():

@ -32,7 +32,7 @@ def find_target_completion(target_func, prefix):
matches = walk_completion_targets(targets, prefix, short) matches = walk_completion_targets(targets, prefix, short)
return matches return matches
except Exception as ex: # pylint: disable=locally-disabled, broad-except except Exception as ex: # pylint: disable=locally-disabled, broad-except
return [str(ex)] return [u'%s' % ex]
def walk_completion_targets(targets, prefix, short=False): def walk_completion_targets(targets, prefix, short=False):

Loading…
Cancel
Save