mirror of
https://github.com/python/cpython.git
synced 2025-12-31 04:23:37 +00:00
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().
This commit is contained in:
parent
2731913dd5
commit
113053a070
4 changed files with 40 additions and 31 deletions
|
|
@ -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().
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue