From cdb2c121245fafe760e74701b43b08fe65c41a49 Mon Sep 17 00:00:00 2001 From: Abhishek Date: Mon, 9 Nov 2026 20:38:33 -0600 Subject: [PATCH 1/2] [psutil] Account for processes without a terminal --- stubs/psutil/psutil/__init__.pyi | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/stubs/psutil/psutil/__init__.pyi b/stubs/psutil/psutil/__init__.pyi index ccfc18019e92..d2ab3648d509 100644 --- a/stubs/psutil/psutil/__init__.pyi +++ b/stubs/psutil/psutil/__init__.pyi @@ -292,7 +292,7 @@ class Process: if sys.platform != "win32": def uids(self) -> _ntp.puids: ... def gids(self) -> _ntp.pgids: ... - def terminal(self) -> str: ... + def terminal(self) -> str | None: ... def num_fds(self) -> int: ... if sys.platform != "darwin": def io_counters(self) -> _ntp.pio: ... From bbec961e848750afd886fd66367fecb7bd692885 Mon Sep 17 00:00:00 2001 From: Abhishek Date: Mon, 9 Nov 2026 20:45:59 -0600 Subject: [PATCH 2/2] Overload Process.nice getter and setter return types --- stubs/psutil/psutil/__init__.pyi | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/stubs/psutil/psutil/__init__.pyi b/stubs/psutil/psutil/__init__.pyi index d2ab3648d509..6c4fda89160f 100644 --- a/stubs/psutil/psutil/__init__.pyi +++ b/stubs/psutil/psutil/__init__.pyi @@ -288,7 +288,12 @@ class Process: def username(self) -> str: ... def create_time(self) -> float: ... def cwd(self) -> str: ... - def nice(self, value: int | None = None) -> int: ... + + @overload + def nice(self, value: None = None) -> int: ... + @overload + def nice(self, value: int) -> None: ... + if sys.platform != "win32": def uids(self) -> _ntp.puids: ... def gids(self) -> _ntp.pgids: ...