Skip to content

Commit 46d7761

Browse files
authored
gh-106316: Remove pytime.h header file (#106317)
Remove the "cpython/pytime.h" header file: it only contained private functions. Move functions to the internal pycore_time.h header file. Move tests from _testcapi to _testinternalcapi. Rename also test methods to have the same name than tested C functions. No longer export these functions: * _PyTime_Add() * _PyTime_As100Nanoseconds() * _PyTime_FromMicrosecondsClamp() * _PyTime_FromTimespec() * _PyTime_FromTimeval() * _PyTime_GetPerfCounterWithInfo() * _PyTime_MulDiv()
1 parent 822db86 commit 46d7761

25 files changed

+650
-667
lines changed

.github/CODEOWNERS

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ Doc/library/time.rst @pganssle @abalkin
7979
Lib/test/test_time.py @pganssle @abalkin
8080
Modules/timemodule.c @pganssle @abalkin
8181
Python/pytime.c @pganssle @abalkin
82-
Include/pytime.h @pganssle @abalkin
82+
Include/internal/pycore_time.h @pganssle @abalkin
8383

8484
# Email and related
8585
**/*mail* @python/email-team

Doc/whatsnew/3.13.rst

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -602,3 +602,6 @@ Removed
602602
use ``PyObject_Vectorcall()`` which is available since Python 3.8
603603
(:pep:`590`).
604604
(Contributed by Victor Stinner in :gh:`106023`.)
605+
606+
* Remove ``cpython/pytime.h`` header file: it only contained private functions.
607+
(Contributed by Victor Stinner in :gh:`106316`.)

Include/Python.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,6 @@
8383
#include "weakrefobject.h"
8484
#include "structseq.h"
8585
#include "cpython/picklebufobject.h"
86-
#include "cpython/pytime.h"
8786
#include "codecs.h"
8887
#include "pyerrors.h"
8988
#include "pythread.h"

Include/cpython/pytime.h

Lines changed: 0 additions & 331 deletions
This file was deleted.

Include/internal/pycore_import.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@
55
extern "C" {
66
#endif
77

8+
#include "pycore_time.h" // _PyTime_t
9+
810

911
struct _import_runtime_state {
1012
/* The builtin modules (defined in config.c). */

0 commit comments

Comments
 (0)