diff options
author | Victor Stinner <vstinner@python.org> | 2024-02-20 16:50:43 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-02-20 16:50:43 (GMT) |
commit | d207c7cd5a8c0d3e5f6c5eb947243e4afcd718b0 (patch) | |
tree | 3c48d470b84dce1673490fb262e4733c105cd315 /Modules | |
parent | e976baba99a5c243ff3a3b5ef2fd14608a398338 (diff) | |
download | cpython-d207c7cd5a8c0d3e5f6c5eb947243e4afcd718b0.zip cpython-d207c7cd5a8c0d3e5f6c5eb947243e4afcd718b0.tar.gz cpython-d207c7cd5a8c0d3e5f6c5eb947243e4afcd718b0.tar.bz2 |
gh-110850: Cleanup pycore_time.h includes (#115724)
<pycore_time.h> include is no longer needed to get the PyTime_t type
in internal header files. This type is now provided by <Python.h>
include. Add <pycore_time.h> includes to C files instead.
Diffstat (limited to 'Modules')
-rw-r--r-- | Modules/_datetimemodule.c | 2 | ||||
-rw-r--r-- | Modules/_lsprof.c | 1 | ||||
-rw-r--r-- | Modules/_randommodule.c | 1 | ||||
-rw-r--r-- | Modules/_ssl.c | 1 | ||||
-rw-r--r-- | Modules/_testinternalcapi/test_lock.c | 3 | ||||
-rw-r--r-- | Modules/_threadmodule.c | 1 | ||||
-rw-r--r-- | Modules/faulthandler.c | 1 | ||||
-rw-r--r-- | Modules/posixmodule.c | 1 | ||||
-rw-r--r-- | Modules/signalmodule.c | 1 | ||||
-rw-r--r-- | Modules/socketmodule.c | 1 | ||||
-rw-r--r-- | Modules/socketmodule.h | 2 | ||||
-rw-r--r-- | Modules/timemodule.c | 1 |
12 files changed, 13 insertions, 3 deletions
diff --git a/Modules/_datetimemodule.c b/Modules/_datetimemodule.c index b8bd702..3ae95a8 100644 --- a/Modules/_datetimemodule.c +++ b/Modules/_datetimemodule.c @@ -14,6 +14,8 @@ #include "Python.h" #include "pycore_long.h" // _PyLong_GetOne() #include "pycore_object.h" // _PyObject_Init() +#include "pycore_time.h" // _PyTime_ObjectToTime_t() + #include "datetime.h" diff --git a/Modules/_lsprof.c b/Modules/_lsprof.c index eae4261..928baf0 100644 --- a/Modules/_lsprof.c +++ b/Modules/_lsprof.c @@ -6,6 +6,7 @@ #include "pycore_call.h" // _PyObject_CallNoArgs() #include "pycore_ceval.h" // _PyEval_SetProfile() #include "pycore_pystate.h" // _PyThreadState_GET() +#include "pycore_time.h" // _PyTime_FromNanosecondsObject() #include "rotatingtree.h" diff --git a/Modules/_randommodule.c b/Modules/_randommodule.c index 4463157..62f1aca 100644 --- a/Modules/_randommodule.c +++ b/Modules/_randommodule.c @@ -75,6 +75,7 @@ #include "pycore_modsupport.h" // _PyArg_NoKeywords() #include "pycore_moduleobject.h" // _PyModule_GetState() #include "pycore_pylifecycle.h" // _PyOS_URandomNonblock() +#include "pycore_time.h" // _PyTime_GetSystemClock() #ifdef HAVE_UNISTD_H # include <unistd.h> // getpid() diff --git a/Modules/_ssl.c b/Modules/_ssl.c index 1bf7241..d00f407 100644 --- a/Modules/_ssl.c +++ b/Modules/_ssl.c @@ -28,6 +28,7 @@ #include "Python.h" #include "pycore_fileutils.h" // _PyIsSelectable_fd() #include "pycore_pyerrors.h" // _PyErr_ChainExceptions1() +#include "pycore_time.h" // _PyDeadline_Init() #include "pycore_weakref.h" // _PyWeakref_GET_REF() /* Include symbols from _socket module */ diff --git a/Modules/_testinternalcapi/test_lock.c b/Modules/_testinternalcapi/test_lock.c index 9facbc5..724bbd0 100644 --- a/Modules/_testinternalcapi/test_lock.c +++ b/Modules/_testinternalcapi/test_lock.c @@ -1,8 +1,9 @@ // C Extension module to test pycore_lock.h API #include "parts.h" - #include "pycore_lock.h" +#include "pycore_time.h" // _PyTime_GetMonotonicClock() + #include "clinic/test_lock.c.h" #ifdef MS_WINDOWS diff --git a/Modules/_threadmodule.c b/Modules/_threadmodule.c index 2260534..addaafb 100644 --- a/Modules/_threadmodule.c +++ b/Modules/_threadmodule.c @@ -9,6 +9,7 @@ #include "pycore_pylifecycle.h" #include "pycore_pystate.h" // _PyThreadState_SetCurrent() #include "pycore_sysmodule.h" // _PySys_GetAttr() +#include "pycore_time.h" // _PyTime_FromSeconds() #include "pycore_weakref.h" // _PyWeakref_GET_REF() #include <stdbool.h> diff --git a/Modules/faulthandler.c b/Modules/faulthandler.c index 91255fc..02e94a2 100644 --- a/Modules/faulthandler.c +++ b/Modules/faulthandler.c @@ -4,6 +4,7 @@ #include "pycore_pystate.h" // _PyThreadState_GET() #include "pycore_signal.h" // Py_NSIG #include "pycore_sysmodule.h" // _PySys_GetAttr() +#include "pycore_time.h" // _PyTime_FromSecondsObject() #include "pycore_traceback.h" // _Py_DumpTracebackThreads #ifdef HAVE_UNISTD_H diff --git a/Modules/posixmodule.c b/Modules/posixmodule.c index 4165fb6..fd70b38 100644 --- a/Modules/posixmodule.c +++ b/Modules/posixmodule.c @@ -23,6 +23,7 @@ #include "pycore_pylifecycle.h" // _PyOS_URandom() #include "pycore_pystate.h" // _PyInterpreterState_GET() #include "pycore_signal.h" // Py_NSIG +#include "pycore_time.h" // _PyLong_FromTime_t() #ifdef HAVE_UNISTD_H # include <unistd.h> // symlink() diff --git a/Modules/signalmodule.c b/Modules/signalmodule.c index a968cb1..5804e30 100644 --- a/Modules/signalmodule.c +++ b/Modules/signalmodule.c @@ -13,6 +13,7 @@ #include "pycore_pyerrors.h" // _PyErr_SetString() #include "pycore_pystate.h" // _PyThreadState_GET() #include "pycore_signal.h" // _Py_RestoreSignals() +#include "pycore_time.h" // _PyTime_FromSecondsObject() #ifndef MS_WINDOWS # include "posixmodule.h" // _PyLong_FromUid() diff --git a/Modules/socketmodule.c b/Modules/socketmodule.c index 9f70dbe..298c0e2 100644 --- a/Modules/socketmodule.c +++ b/Modules/socketmodule.c @@ -109,6 +109,7 @@ Local naming conventions: #include "pycore_capsule.h" // _PyCapsule_SetTraverse() #include "pycore_fileutils.h" // _Py_set_inheritable() #include "pycore_moduleobject.h" // _PyModule_GetState +#include "pycore_time.h" // _PyTime_AsMilliseconds() #ifdef _Py_MEMORY_SANITIZER # include <sanitizer/msan_interface.h> diff --git a/Modules/socketmodule.h b/Modules/socketmodule.h index a7c592c..09fd70f 100644 --- a/Modules/socketmodule.h +++ b/Modules/socketmodule.h @@ -1,7 +1,5 @@ /* Socket module header file */ -#include "pycore_time.h" // PyTime_t - /* Includes needed for the sockaddr_* symbols below */ #ifndef MS_WINDOWS #ifdef __VMS diff --git a/Modules/timemodule.c b/Modules/timemodule.c index 16769b2..73b9fc0 100644 --- a/Modules/timemodule.c +++ b/Modules/timemodule.c @@ -5,6 +5,7 @@ #include "pycore_moduleobject.h" // _PyModule_GetState() #include "pycore_namespace.h" // _PyNamespace_New() #include "pycore_runtime.h" // _Py_ID() +#include "pycore_time.h" // _PyTimeFraction #include <time.h> // clock() #ifdef HAVE_SYS_TIMES_H |