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
|
|
@ -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