diff options
author | Victor Stinner <vstinner@python.org> | 2024-03-11 16:35:29 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-03-11 16:35:29 (GMT) |
commit | 113053a070ba753101f73553ef6435c5c6c9f3f7 (patch) | |
tree | 9f97e4dc49ceafd5a464f169d142225e170ab7be /Include/internal | |
parent | 2731913dd5234ff5ab630a3b7f1c98ad79d4d9df (diff) | |
download | cpython-113053a070ba753101f73553ef6435c5c6c9f3f7.zip cpython-113053a070ba753101f73553ef6435c5c6c9f3f7.tar.gz cpython-113053a070ba753101f73553ef6435c5c6c9f3f7.tar.bz2 |
gh-110850: Fix _PyTime_FromSecondsDouble() API (#116606)
Return 0 on success. Set an exception and return -1 on error.
Fix os.timerfd_settime(): properly report exceptions on
_PyTime_FromSecondsDouble() failure.
No longer export _PyTime_FromSecondsDouble().
Diffstat (limited to 'Include/internal')
-rw-r--r-- | Include/internal/pycore_time.h | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/Include/internal/pycore_time.h b/Include/internal/pycore_time.h index 40b28e0..138d60f 100644 --- a/Include/internal/pycore_time.h +++ b/Include/internal/pycore_time.h @@ -132,8 +132,10 @@ PyAPI_FUNC(int) _PyTime_ObjectToTimespec( PyAPI_FUNC(PyTime_t) _PyTime_FromSeconds(int seconds); // Create a timestamp from a number of seconds in double. -// Export for '_socket' shared extension. -PyAPI_FUNC(PyTime_t) _PyTime_FromSecondsDouble(double seconds, _PyTime_round_t round); +extern int _PyTime_FromSecondsDouble( + double seconds, + _PyTime_round_t round, + PyTime_t *result); // Macro to create a timestamp from a number of seconds, no integer overflow. // Only use the macro for small values, prefer _PyTime_FromSeconds(). |