mirror of
https://github.com/pre-commit/pre-commit.git
synced 2026-02-17 08:14:42 +04:00
Replace five with six
This commit is contained in:
parent
cb8dd335f4
commit
c65a11ce3d
9 changed files with 27 additions and 57 deletions
|
|
@ -10,6 +10,7 @@ import subprocess
|
|||
import tempfile
|
||||
|
||||
import pkg_resources
|
||||
import six
|
||||
|
||||
from pre_commit import five
|
||||
from pre_commit import parse_shebang
|
||||
|
|
@ -143,12 +144,12 @@ class CalledProcessError(RuntimeError):
|
|||
def to_text(self):
|
||||
return self.to_bytes().decode('UTF-8')
|
||||
|
||||
if five.PY3: # pragma: no cover (py3)
|
||||
__bytes__ = to_bytes
|
||||
__str__ = to_text
|
||||
else: # pragma: no cover (py2)
|
||||
if six.PY2: # pragma: no cover (py2)
|
||||
__str__ = to_bytes
|
||||
__unicode__ = to_text
|
||||
else: # pragma: no cover (py3)
|
||||
__bytes__ = to_bytes
|
||||
__str__ = to_text
|
||||
|
||||
|
||||
def cmd_output(*cmd, **kwargs):
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue