Skip to content

Commit

Permalink
pythongh-106316: Remove pytime.h header file (python#106317)
Browse files Browse the repository at this point in the history
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()
  • Loading branch information
vstinner committed Jul 1, 2023
1 parent 822db86 commit 46d7761
Show file tree
Hide file tree
Showing 25 changed files with 650 additions and 667 deletions.
2 changes: 1 addition & 1 deletion .github/CODEOWNERS
Validating CODEOWNERS rules …
Expand Up @@ -79,7 +79,7 @@ Doc/library/time.rst @pganssle @abalkin
Lib/test/test_time.py @pganssle @abalkin
Modules/timemodule.c @pganssle @abalkin
Python/pytime.c @pganssle @abalkin
Include/pytime.h @pganssle @abalkin
Include/internal/pycore_time.h @pganssle @abalkin

# Email and related
**/*mail* @python/email-team
Expand Down
3 changes: 3 additions & 0 deletions Doc/whatsnew/3.13.rst
Expand Up @@ -602,3 +602,6 @@ Removed
use ``PyObject_Vectorcall()`` which is available since Python 3.8
(:pep:`590`).
(Contributed by Victor Stinner in :gh:`106023`.)

* Remove ``cpython/pytime.h`` header file: it only contained private functions.
(Contributed by Victor Stinner in :gh:`106316`.)
1 change: 0 additions & 1 deletion Include/Python.h
Expand Up @@ -83,7 +83,6 @@
#include "weakrefobject.h"
#include "structseq.h"
#include "cpython/picklebufobject.h"
#include "cpython/pytime.h"
#include "codecs.h"
#include "pyerrors.h"
#include "pythread.h"
Expand Down
331 changes: 0 additions & 331 deletions Include/cpython/pytime.h

This file was deleted.

2 changes: 2 additions & 0 deletions Include/internal/pycore_import.h
Expand Up @@ -5,6 +5,8 @@
extern "C" {
#endif

#include "pycore_time.h" // _PyTime_t


struct _import_runtime_state {
/* The builtin modules (defined in config.c). */
Expand Down

0 comments on commit 46d7761

Please sign in to comment.