https://github.com/python/cpython/commit/e004914045ad811da5b497e5dadaec9a1b4535ed
commit: e004914045ad811da5b497e5dadaec9a1b4535ed
branch: 3.12
author: Miss Islington (bot) <31488909+miss-isling...@users.noreply.github.com>
committer: sobolevn <m...@sobolevn.me>
date: 2024-06-17T07:01:15Z
summary:

[3.12] gh-120586: Fix several "unused function" warnings in `posixmodule.c` 
(GH-120588) (#120617)

gh-120586: Fix several "unused function" warnings in `posixmodule.c` (GH-120588)
(cherry picked from commit 3df2022931f77c5cadb3f51b371be6ae17587ede)

Co-authored-by: Nikita Sobolev <m...@sobolevn.me>

files:
M Modules/posixmodule.c

diff --git a/Modules/posixmodule.c b/Modules/posixmodule.c
index 9cc53c86f6eba9..77606874003238 100644
--- a/Modules/posixmodule.c
+++ b/Modules/posixmodule.c
@@ -7579,6 +7579,7 @@ os_register_at_fork_impl(PyObject *module, PyObject 
*before,
 }
 #endif /* HAVE_FORK */
 
+#if defined(HAVE_FORK1) || defined(HAVE_FORKPTY) || defined(HAVE_FORK)
 // Common code to raise a warning if we detect there is more than one thread
 // running in the process. Best effort, silent if unable to count threads.
 // Constraint: Quick. Never overcounts. Never leaves an error set.
@@ -7677,6 +7678,7 @@ static void warn_about_fork_with_threads(const char* 
name) {
         PyErr_Clear();
     }
 }
+#endif  // HAVE_FORK1 || HAVE_FORKPTY || HAVE_FORK
 
 #ifdef HAVE_FORK1
 /*[clinic input]
@@ -11783,6 +11785,7 @@ os_mknod_impl(PyObject *module, path_t *path, int mode, 
dev_t device,
 #endif /* defined(HAVE_MKNOD) && defined(HAVE_MAKEDEV) */
 
 
+#ifdef HAVE_DEVICE_MACROS
 static PyObject *
 major_minor_conv(unsigned int value)
 {
@@ -11805,7 +11808,6 @@ major_minor_check(dev_t value)
     return (dev_t)(unsigned int)value == value;
 }
 
-#ifdef HAVE_DEVICE_MACROS
 /*[clinic input]
 os.major
 

_______________________________________________
Python-checkins mailing list -- python-checkins@python.org
To unsubscribe send an email to python-checkins-le...@python.org
https://mail.python.org/mailman3/lists/python-checkins.python.org/
Member address: arch...@mail-archive.com

Reply via email to