https://github.com/python/cpython/commit/39608781437e3ab9b3be88bfdb99ac0e4ac78576
commit: 39608781437e3ab9b3be88bfdb99ac0e4ac78576
branch: main
author: Yongtao Huang <[email protected]>
committer: encukou <[email protected]>
date: 2025-12-22T11:16:50+01:00
summary:

Remove unreachable code in mmapmodule error path on Windows (GH-143063)

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 <[email protected]>

files:
M Modules/mmapmodule.c

diff --git a/Modules/mmapmodule.c b/Modules/mmapmodule.c
index ea20fb29c90228..0928ea6a8b70ba 100644
--- a/Modules/mmapmodule.c
+++ b/Modules/mmapmodule.c
@@ -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

_______________________________________________
Python-checkins mailing list -- [email protected]
To unsubscribe send an email to [email protected]
https://mail.python.org/mailman3//lists/python-checkins.python.org
Member address: [email protected]

Reply via email to