mirror of
https://github.com/pre-commit/pre-commit.git
synced 2026-02-17 08:14:42 +04:00
Replace EnvironT with MutableMapping[str, str]
This commit is contained in:
parent
a0c0870b87
commit
24dfeed89c
6 changed files with 17 additions and 19 deletions
|
|
@ -9,6 +9,7 @@ from typing import Callable
|
|||
from typing import Generator
|
||||
from typing import Iterable
|
||||
from typing import List
|
||||
from typing import MutableMapping
|
||||
from typing import Optional
|
||||
from typing import Sequence
|
||||
from typing import Tuple
|
||||
|
|
@ -17,13 +18,12 @@ from typing import TypeVar
|
|||
from pre_commit import parse_shebang
|
||||
from pre_commit.util import cmd_output_b
|
||||
from pre_commit.util import cmd_output_p
|
||||
from pre_commit.util import EnvironT
|
||||
|
||||
TArg = TypeVar('TArg')
|
||||
TRet = TypeVar('TRet')
|
||||
|
||||
|
||||
def _environ_size(_env: Optional[EnvironT] = None) -> int:
|
||||
def _environ_size(_env: Optional[MutableMapping[str, str]] = None) -> int:
|
||||
environ = _env if _env is not None else getattr(os, 'environb', os.environ)
|
||||
size = 8 * len(environ) # number of pointers in `envp`
|
||||
for k, v in environ.items():
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue