From aaa3976a29c1e4099029adaabebe2b076a3ad052 Mon Sep 17 00:00:00 2001 From: Anthony Sottile Date: Tue, 13 Nov 2018 17:23:32 -0800 Subject: [PATCH] Use text_type instead of str() --- pre_commit/commands/autoupdate.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/pre_commit/commands/autoupdate.py b/pre_commit/commands/autoupdate.py index 0bff116c..d93d7e11 100644 --- a/pre_commit/commands/autoupdate.py +++ b/pre_commit/commands/autoupdate.py @@ -4,6 +4,7 @@ from __future__ import unicode_literals import re from collections import OrderedDict +import six from aspy.yaml import ordered_dump from aspy.yaml import ordered_load from cfgv import remove_defaults @@ -58,7 +59,7 @@ def _update_repo(repo_config, store, tags_only): try: new_hooks = Repository.create(new_config, store).manifest_hooks except InvalidManifestError as e: - raise RepositoryCannotBeUpdatedError(e.args[0]) + raise RepositoryCannotBeUpdatedError(six.text_type(e)) # See if any of our hooks were deleted with the new commits hooks = {hook['id'] for hook in repo_config['hooks']} @@ -133,7 +134,7 @@ def autoupdate(runner, store, tags_only, repos=()): try: new_repo_config = _update_repo(repo_config, store, tags_only) except RepositoryCannotBeUpdatedError as error: - output.write_line(str(error)) + output.write_line(error.args[0]) output_repos.append(repo_config) retv = 1 continue