Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit aaa3976

Browse files
committed
Use text_type instead of str()
1 parent e339de2 commit aaa3976

1 file changed

Lines changed: 3 additions & 2 deletions

File tree

pre_commit/commands/autoupdate.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
import re
55
from collections import OrderedDict
66

7+
import six
78
from aspy.yaml import ordered_dump
89
from aspy.yaml import ordered_load
910
from cfgv import remove_defaults
@@ -58,7 +59,7 @@ def _update_repo(repo_config, store, tags_only):
5859
try:
5960
new_hooks = Repository.create(new_config, store).manifest_hooks
6061
except InvalidManifestError as e:
61-
raise RepositoryCannotBeUpdatedError(e.args[0])
62+
raise RepositoryCannotBeUpdatedError(six.text_type(e))
6263

6364
# See if any of our hooks were deleted with the new commits
6465
hooks = {hook['id'] for hook in repo_config['hooks']}
@@ -133,7 +134,7 @@ def autoupdate(runner, store, tags_only, repos=()):
133134
try:
134135
new_repo_config = _update_repo(repo_config, store, tags_only)
135136
except RepositoryCannotBeUpdatedError as error:
136-
output.write_line(str(error))
137+
output.write_line(error.args[0])
137138
output_repos.append(repo_config)
138139
retv = 1
139140
continue

0 commit comments

Comments
 (0)