Skip to content

Commit 4ea52b3

Browse files
Update resource.prlimit for Python 3.12+ (#10794)
Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
1 parent ac4f4a4 commit 4ea52b3

File tree

2 files changed

+4
-6
lines changed

2 files changed

+4
-6
lines changed

stdlib/resource.pyi

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
import sys
22
from _typeshed import structseq
3-
from typing import overload
43
from typing_extensions import Final, final
54

65
if sys.platform != "win32":
@@ -86,8 +85,8 @@ if sys.platform != "win32":
8685
def getrusage(__who: int) -> struct_rusage: ...
8786
def setrlimit(__resource: int, __limits: tuple[int, int]) -> None: ...
8887
if sys.platform == "linux":
89-
@overload
90-
def prlimit(pid: int, resource: int, limits: tuple[int, int]) -> tuple[int, int]: ...
91-
@overload
92-
def prlimit(pid: int, resource: int) -> tuple[int, int]: ...
88+
if sys.version_info >= (3, 12):
89+
def prlimit(__pid: int, __resource: int, __limits: tuple[int, int] | None = None) -> tuple[int, int]: ...
90+
else:
91+
def prlimit(__pid: int, __resource: int, __limits: tuple[int, int] = ...) -> tuple[int, int]: ...
9392
error = OSError

tests/stubtest_allowlists/linux-py312.txt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
_?curses.color_pair
22
_posixsubprocess.fork_exec
3-
resource.prlimit
43
signal.sigtimedwait
54
signal.sigwaitinfo
65
xxlimited.Xxo.x_exports

0 commit comments

Comments
 (0)