diff --git a/stubs/pexpect/pexpect/popen_spawn.pyi b/stubs/pexpect/pexpect/popen_spawn.pyi index a13b49b6cc21..601595a9d00c 100644 --- a/stubs/pexpect/pexpect/popen_spawn.pyi +++ b/stubs/pexpect/pexpect/popen_spawn.pyi @@ -1,7 +1,6 @@ import subprocess from _typeshed import StrOrBytesPath from collections.abc import Callable -from os import _Environ from typing import AnyStr from .spawnbase import SpawnBase, _Logfile @@ -17,7 +16,7 @@ class PopenSpawn(SpawnBase[AnyStr]): searchwindowsize: int | None = None, logfile: _Logfile | None = None, cwd: StrOrBytesPath | None = None, - env: _Environ[str] | None = None, + env: subprocess._ENV | None = None, encoding: str | None = None, codec_errors: str = "strict", preexec_fn: Callable[[], None] | None = None, diff --git a/stubs/pexpect/pexpect/pty_spawn.pyi b/stubs/pexpect/pexpect/pty_spawn.pyi index 64a9546ee8bb..cecc298c0376 100644 --- a/stubs/pexpect/pexpect/pty_spawn.pyi +++ b/stubs/pexpect/pexpect/pty_spawn.pyi @@ -1,6 +1,5 @@ from _typeshed import FileDescriptorOrPath -from collections.abc import Callable -from os import _Environ +from collections.abc import Callable, Mapping from typing import AnyStr from .spawnbase import SpawnBase, _Logfile @@ -14,7 +13,7 @@ class spawn(SpawnBase[AnyStr]): STDERR_FILENO: int str_last_chars: int cwd: FileDescriptorOrPath | None - env: _Environ[str] + env: Mapping[str, str] | None echo: bool ignore_sighup: bool command: str @@ -30,7 +29,7 @@ class spawn(SpawnBase[AnyStr]): searchwindowsize: int | None = None, logfile: _Logfile | None = None, cwd: FileDescriptorOrPath | None = None, - env: _Environ[str] | None = None, + env: Mapping[str, str] | None = None, ignore_sighup: bool = False, echo: bool = True, preexec_fn: Callable[[], None] | None = None, @@ -84,7 +83,7 @@ def spawnu( searchwindowsize: int | None = None, logfile: _Logfile | None = None, cwd: FileDescriptorOrPath | None = None, - env: _Environ[str] | None = None, + env: Mapping[str, str] | None = None, ignore_sighup: bool = False, echo: bool = True, preexec_fn: Callable[[], None] | None = None, diff --git a/stubs/pexpect/pexpect/pxssh.pyi b/stubs/pexpect/pexpect/pxssh.pyi index 1cc1fed50e65..2904e0ab628b 100644 --- a/stubs/pexpect/pexpect/pxssh.pyi +++ b/stubs/pexpect/pexpect/pxssh.pyi @@ -1,5 +1,5 @@ from _typeshed import FileDescriptorOrPath -from os import _Environ +from collections.abc import Mapping from typing import AnyStr, Literal from .exceptions import ExceptionPexpect @@ -28,7 +28,7 @@ class pxssh(spawn[AnyStr]): searchwindowsize: int | None = None, logfile: _Logfile | None = None, cwd: FileDescriptorOrPath | None = None, - env: _Environ[str] | None = None, + env: Mapping[str, str] | None = None, ignore_sighup: bool = True, echo: bool = True, options: dict[str, str] = {}, diff --git a/stubs/pexpect/pexpect/run.pyi b/stubs/pexpect/pexpect/run.pyi index 5a53ecb1e2c1..b3b0a0b546ad 100644 --- a/stubs/pexpect/pexpect/run.pyi +++ b/stubs/pexpect/pexpect/run.pyi @@ -1,5 +1,5 @@ from _typeshed import FileDescriptorOrPath -from os import _Environ +from collections.abc import Mapping from typing import AnyStr from .spawnbase import _InputRePattern, _Logfile @@ -12,7 +12,7 @@ def run( extra_args: None = None, logfile: _Logfile | None = None, cwd: FileDescriptorOrPath | None = None, - env: _Environ[str] | None = None, + env: Mapping[str, str] | None = None, **kwargs, ) -> AnyStr | tuple[AnyStr, int]: ... def runu( @@ -23,6 +23,6 @@ def runu( extra_args: None = None, logfile: _Logfile | None = None, cwd: FileDescriptorOrPath | None = None, - env: _Environ[str] | None = None, + env: Mapping[str, str] | None = None, **kwargs, ) -> AnyStr | tuple[AnyStr, int]: ... diff --git a/stubs/pexpect/pexpect/utils.pyi b/stubs/pexpect/pexpect/utils.pyi index 285cdb2ce8e5..29fd1ae2b2cd 100644 --- a/stubs/pexpect/pexpect/utils.pyi +++ b/stubs/pexpect/pexpect/utils.pyi @@ -1,10 +1,10 @@ -from os import _Environ +from collections.abc import Mapping InterruptedError: type string_types: tuple[type, ...] def is_executable_file(path): ... -def which(filename, env: _Environ[str] | None = None): ... +def which(filename, env: Mapping[str, str] | None = None): ... def split_command_line(command_line): ... def select_ignore_interrupts(iwtd, owtd, ewtd, timeout: float | None = None): ... def poll_ignore_interrupts(fds, timeout: float | None = None): ...