mirror of
https://github.com/pre-commit/pre-commit.git
synced 2026-04-15 18:11:48 +04:00
Use text_type instead of str()
This commit is contained in:
parent
e339de22d7
commit
aaa3976a29
1 changed files with 3 additions and 2 deletions
|
|
@ -4,6 +4,7 @@ from __future__ import unicode_literals
|
||||||
import re
|
import re
|
||||||
from collections import OrderedDict
|
from collections import OrderedDict
|
||||||
|
|
||||||
|
import six
|
||||||
from aspy.yaml import ordered_dump
|
from aspy.yaml import ordered_dump
|
||||||
from aspy.yaml import ordered_load
|
from aspy.yaml import ordered_load
|
||||||
from cfgv import remove_defaults
|
from cfgv import remove_defaults
|
||||||
|
|
@ -58,7 +59,7 @@ def _update_repo(repo_config, store, tags_only):
|
||||||
try:
|
try:
|
||||||
new_hooks = Repository.create(new_config, store).manifest_hooks
|
new_hooks = Repository.create(new_config, store).manifest_hooks
|
||||||
except InvalidManifestError as e:
|
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
|
# See if any of our hooks were deleted with the new commits
|
||||||
hooks = {hook['id'] for hook in repo_config['hooks']}
|
hooks = {hook['id'] for hook in repo_config['hooks']}
|
||||||
|
|
@ -133,7 +134,7 @@ def autoupdate(runner, store, tags_only, repos=()):
|
||||||
try:
|
try:
|
||||||
new_repo_config = _update_repo(repo_config, store, tags_only)
|
new_repo_config = _update_repo(repo_config, store, tags_only)
|
||||||
except RepositoryCannotBeUpdatedError as error:
|
except RepositoryCannotBeUpdatedError as error:
|
||||||
output.write_line(str(error))
|
output.write_line(error.args[0])
|
||||||
output_repos.append(repo_config)
|
output_repos.append(repo_config)
|
||||||
retv = 1
|
retv = 1
|
||||||
continue
|
continue
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue