mirror of
https://github.com/pre-commit/pre-commit.git
synced 2026-02-17 08:14:42 +04:00
upgrade hooks, pyupgrade pre-commit
This commit is contained in:
parent
764c765d29
commit
30c1e8289f
91 changed files with 176 additions and 437 deletions
|
|
@ -1,5 +1,3 @@
|
|||
from __future__ import unicode_literals
|
||||
|
||||
import contextlib
|
||||
import errno
|
||||
import os.path
|
||||
|
|
@ -9,8 +7,6 @@ import subprocess
|
|||
import sys
|
||||
import tempfile
|
||||
|
||||
import six
|
||||
|
||||
from pre_commit import five
|
||||
from pre_commit import parse_shebang
|
||||
|
||||
|
|
@ -75,7 +71,7 @@ def make_executable(filename):
|
|||
|
||||
class CalledProcessError(RuntimeError):
|
||||
def __init__(self, returncode, cmd, expected_returncode, stdout, stderr):
|
||||
super(CalledProcessError, self).__init__(
|
||||
super().__init__(
|
||||
returncode, cmd, expected_returncode, stdout, stderr,
|
||||
)
|
||||
self.returncode = returncode
|
||||
|
|
@ -104,12 +100,8 @@ class CalledProcessError(RuntimeError):
|
|||
def to_text(self):
|
||||
return self.to_bytes().decode('UTF-8')
|
||||
|
||||
if six.PY2: # pragma: no cover (py2)
|
||||
__str__ = to_bytes
|
||||
__unicode__ = to_text
|
||||
else: # pragma: no cover (py3)
|
||||
__bytes__ = to_bytes
|
||||
__str__ = to_text
|
||||
__bytes__ = to_bytes
|
||||
__str__ = to_text
|
||||
|
||||
|
||||
def _cmd_kwargs(*cmd, **kwargs):
|
||||
|
|
@ -154,7 +146,7 @@ if os.name != 'nt': # pragma: windows no cover
|
|||
from os import openpty
|
||||
import termios
|
||||
|
||||
class Pty(object):
|
||||
class Pty:
|
||||
def __init__(self):
|
||||
self.r = self.w = None
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue