From 5b1ef8b119bbc3304cd121b459187e07f90e8c6d Mon Sep 17 00:00:00 2001 From: Shantanu <12621235+hauntsaninja@users.noreply.github.com> Date: Sun, 22 May 2022 15:30:09 -0700 Subject: [PATCH] mmap: add MADV_FREE on darwin (#7923) Co-authored-by: hauntsaninja <> --- stdlib/mmap.pyi | 2 +- tests/stubtest_allowlists/darwin-py310.txt | 3 --- tests/stubtest_allowlists/darwin-py311.txt | 3 --- tests/stubtest_allowlists/darwin-py38.txt | 3 --- tests/stubtest_allowlists/darwin-py39.txt | 3 --- 5 files changed, 1 insertion(+), 13 deletions(-) diff --git a/stdlib/mmap.pyi b/stdlib/mmap.pyi index 96bb01a27..8dbec2388 100644 --- a/stdlib/mmap.pyi +++ b/stdlib/mmap.pyi @@ -79,6 +79,7 @@ if sys.version_info >= (3, 8) and sys.platform != "win32": MADV_SEQUENTIAL: int MADV_WILLNEED: int MADV_DONTNEED: int + MADV_FREE: int if sys.platform == "linux": MADV_REMOVE: int @@ -94,7 +95,6 @@ if sys.version_info >= (3, 8) and sys.platform != "win32": MADV_NOHUGEPAGE: int MADV_DONTDUMP: int MADV_DODUMP: int - MADV_FREE: int # This Values are defined for FreeBSD but type checkers do not support conditions for these if sys.platform != "linux" and sys.platform != "darwin": diff --git a/tests/stubtest_allowlists/darwin-py310.txt b/tests/stubtest_allowlists/darwin-py310.txt index d3aa8357f..5fe85281c 100644 --- a/tests/stubtest_allowlists/darwin-py310.txt +++ b/tests/stubtest_allowlists/darwin-py310.txt @@ -1,9 +1,6 @@ _?curses.A_ITALIC _?curses.color_pair webbrowser.MacOSXOSAScript.__init__ - -# Exists at runtime, but missing from stubs -mmap.MADV_FREE distutils.util.__warningregistry__ # ========== diff --git a/tests/stubtest_allowlists/darwin-py311.txt b/tests/stubtest_allowlists/darwin-py311.txt index dd278cb09..f9916b54f 100644 --- a/tests/stubtest_allowlists/darwin-py311.txt +++ b/tests/stubtest_allowlists/darwin-py311.txt @@ -3,7 +3,4 @@ _?curses.color_pair termios.tcgetwinsize termios.tcsetwinsize xxlimited.Xxo.x_exports - -# Exists at runtime, but missing from stubs -mmap.MADV_FREE distutils.util.__warningregistry__ diff --git a/tests/stubtest_allowlists/darwin-py38.txt b/tests/stubtest_allowlists/darwin-py38.txt index 6edf54de4..e2765c244 100644 --- a/tests/stubtest_allowlists/darwin-py38.txt +++ b/tests/stubtest_allowlists/darwin-py38.txt @@ -1,9 +1,6 @@ _?curses.A_ITALIC webbrowser.MacOSXOSAScript.__init__ -# Exists at runtime, but missing from stubs -mmap.MADV_FREE - # ========== # Allowlist entries that cannot or should not be fixed # ========== diff --git a/tests/stubtest_allowlists/darwin-py39.txt b/tests/stubtest_allowlists/darwin-py39.txt index 6edf54de4..e2765c244 100644 --- a/tests/stubtest_allowlists/darwin-py39.txt +++ b/tests/stubtest_allowlists/darwin-py39.txt @@ -1,9 +1,6 @@ _?curses.A_ITALIC webbrowser.MacOSXOSAScript.__init__ -# Exists at runtime, but missing from stubs -mmap.MADV_FREE - # ========== # Allowlist entries that cannot or should not be fixed # ==========