From 5e23194d9407bca97aed798ea1b0d553db1eee94 Mon Sep 17 00:00:00 2001 From: Zackery Spytz Date: Thu, 4 Sep 2025 01:50:03 -0700 Subject: [PATCH] gh-87595: Fix the docs for mmap.size() Correct some parts of the docs added in 32032ee376 that weren't written by me. --- Doc/library/mmap.rst | 4 ++-- .../next/Library/2021-03-07-16-31-36.bpo-43429.Koa0mf.rst | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/Doc/library/mmap.rst b/Doc/library/mmap.rst index d9d401a2789c0e..9c0b828fbd4d28 100644 --- a/Doc/library/mmap.rst +++ b/Doc/library/mmap.rst @@ -324,10 +324,10 @@ To map anonymous memory, -1 should be passed as the fileno along with the length Return the length of the file, which can be larger than the size of the memory-mapped area. - For anonymous mapping, return its size. + For an anonymous mapping, return its size. .. versionchanged:: next - Supports anonymous mapping on Unix. + Anonymous mappings are now supported on Unix. .. method:: tell() diff --git a/Misc/NEWS.d/next/Library/2021-03-07-16-31-36.bpo-43429.Koa0mf.rst b/Misc/NEWS.d/next/Library/2021-03-07-16-31-36.bpo-43429.Koa0mf.rst index a6221ba9c88585..0919e2c6ae1d8a 100644 --- a/Misc/NEWS.d/next/Library/2021-03-07-16-31-36.bpo-43429.Koa0mf.rst +++ b/Misc/NEWS.d/next/Library/2021-03-07-16-31-36.bpo-43429.Koa0mf.rst @@ -1,5 +1,5 @@ The :meth:`~mmap.mmap.size` method of the :class:`mmap.mmap` class now returns the size of an anonymous mapping on both Unix and Windows. Previously, the size would be returned on Windows and an :exc:`OSError` -would be raised on Unix. -Raise :exc:`ValueError` instead of :exc:`OSError` with ``trackfd=False``. +would be raised on Unix. :exc:`ValueError` is now raised instead of +:exc:`OSError` when ``trackfd=False``.