mirror of
https://github.com/pre-commit/pre-commit.git
synced 2026-02-17 08:14:42 +04:00
Fix pre-commit in python 3.6.0-3.6.1
This commit is contained in:
parent
0cc199d351
commit
9e4dc7f349
3 changed files with 11 additions and 4 deletions
|
|
@ -15,6 +15,7 @@ repos:
|
|||
rev: 3.7.9
|
||||
hooks:
|
||||
- id: flake8
|
||||
additional_dependencies: [flake8-typing-imports==1.5.0]
|
||||
- repo: https://github.com/pre-commit/mirrors-autopep8
|
||||
rev: v1.4.4
|
||||
hooks:
|
||||
|
|
|
|||
|
|
@ -3,11 +3,11 @@ import os
|
|||
import random
|
||||
from typing import Any
|
||||
from typing import List
|
||||
from typing import NoReturn
|
||||
from typing import Optional
|
||||
from typing import overload
|
||||
from typing import Sequence
|
||||
from typing import Tuple
|
||||
from typing import TYPE_CHECKING
|
||||
|
||||
import pre_commit.constants as C
|
||||
from pre_commit.hook import Hook
|
||||
|
|
@ -15,6 +15,9 @@ from pre_commit.prefix import Prefix
|
|||
from pre_commit.util import cmd_output_b
|
||||
from pre_commit.xargs import xargs
|
||||
|
||||
if TYPE_CHECKING:
|
||||
from typing import NoReturn
|
||||
|
||||
FIXED_RANDOM_SEED = 1542676186
|
||||
|
||||
|
||||
|
|
@ -65,7 +68,7 @@ def no_install(
|
|||
prefix: Prefix,
|
||||
version: str,
|
||||
additional_dependencies: Sequence[str],
|
||||
) -> NoReturn:
|
||||
) -> 'NoReturn':
|
||||
raise AssertionError('This type is not installable')
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -1,11 +1,14 @@
|
|||
import os.path
|
||||
from typing import Mapping
|
||||
from typing import NoReturn
|
||||
from typing import Optional
|
||||
from typing import Tuple
|
||||
from typing import TYPE_CHECKING
|
||||
|
||||
from identify.identify import parse_shebang_from_file
|
||||
|
||||
if TYPE_CHECKING:
|
||||
from typing import NoReturn
|
||||
|
||||
|
||||
class ExecutableNotFoundError(OSError):
|
||||
def to_output(self) -> Tuple[int, bytes, None]:
|
||||
|
|
@ -44,7 +47,7 @@ def find_executable(
|
|||
|
||||
|
||||
def normexe(orig: str) -> str:
|
||||
def _error(msg: str) -> NoReturn:
|
||||
def _error(msg: str) -> 'NoReturn':
|
||||
raise ExecutableNotFoundError(f'Executable `{orig}` {msg}')
|
||||
|
||||
if os.sep not in orig and (not os.altsep or os.altsep not in orig):
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue