]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
Remove unreachable code in mmapmodule error path on Windows (GH-143063)
authorYongtao Huang <yongtaoh2022@gmail.com>
Mon, 22 Dec 2025 10:16:50 +0000 (18:16 +0800)
committerGitHub <noreply@github.com>
Mon, 22 Dec 2025 10:16:50 +0000 (11:16 +0100)
mmapmodule: remove unreachable code in Windows error path

Remove an unreachable `return NULL` after `PyErr_SetFromWindowsErr()` in
the Windows mmap resize error path.

Signed-off-by: Yongtao Huang <yongtaoh2022@gmail.com>
Modules/mmapmodule.c

index ea20fb29c902285d49a89ba19a54763e6ce14026..0928ea6a8b70ba0bc7778b69a66e833c6e928102 100644 (file)
@@ -963,7 +963,6 @@ mmap_mmap_resize_impl(mmap_object *self, Py_ssize_t new_size)
 
         if (error) {
             return PyErr_SetFromWindowsErr(error);
-            return NULL;
         }
         /* It's possible for a resize to fail, typically because another mapping
         is still held against the same underlying file. Even if nothing has