https://github.com/python/cpython/commit/77430b6a329bb04ca884d08afefda25112372afa
commit: 77430b6a329bb04ca884d08afefda25112372afa
branch: main
author: Victor Stinner <[email protected]>
committer: vstinner <[email protected]>
date: 2024-02-21T08:11:40Z
summary:
gh-110850: Replace private _PyTime_MAX with public PyTime_MAX (#115751)
Remove references to the old names _PyTime_MIN
and _PyTime_MAX, now that PyTime_MIN and
PyTime_MAX are public.
Replace also _PyTime_MIN with PyTime_MIN.
files:
M Include/internal/pycore_time.h
M Modules/_threadmodule.c
M Python/thread_pthread.h
diff --git a/Include/internal/pycore_time.h b/Include/internal/pycore_time.h
index 682aee2170bdae..57ee55f14414a7 100644
--- a/Include/internal/pycore_time.h
+++ b/Include/internal/pycore_time.h
@@ -318,10 +318,6 @@ extern int _PyTime_PerfCounterWithInfo(
PyTime_t *t,
_Py_clock_info_t *info);
-// Alias for backward compatibility
-#define _PyTime_MIN PyTime_MIN
-#define _PyTime_MAX PyTime_MAX
-
// --- _PyDeadline -----------------------------------------------------------
@@ -352,7 +348,7 @@ extern int _PyTimeFraction_Set(
PyTime_t denom);
// Compute ticks * frac.numer / frac.denom.
-// Clamp to [_PyTime_MIN; _PyTime_MAX] on overflow.
+// Clamp to [PyTime_MIN; PyTime_MAX] on overflow.
extern PyTime_t _PyTimeFraction_Mul(
PyTime_t ticks,
const _PyTimeFraction *frac);
diff --git a/Modules/_threadmodule.c b/Modules/_threadmodule.c
index 25e10027879055..4c2185cc7ea1fd 100644
--- a/Modules/_threadmodule.c
+++ b/Modules/_threadmodule.c
@@ -1948,7 +1948,7 @@ thread_module_exec(PyObject *module)
// TIMEOUT_MAX
double timeout_max = (double)PY_TIMEOUT_MAX * 1e-6;
- double time_max = PyTime_AsSecondsDouble(_PyTime_MAX);
+ double time_max = PyTime_AsSecondsDouble(PyTime_MAX);
timeout_max = Py_MIN(timeout_max, time_max);
// Round towards minus infinity
timeout_max = floor(timeout_max);
diff --git a/Python/thread_pthread.h b/Python/thread_pthread.h
index 17f6ae7eb70553..dee21f028ac48c 100644
--- a/Python/thread_pthread.h
+++ b/Python/thread_pthread.h
@@ -486,9 +486,9 @@ PyThread_acquire_lock_timed(PyThread_type_lock lock,
PY_TIMEOUT_T microseconds,
if (microseconds >= 0) {
// bpo-41710: PyThread_acquire_lock_timed() cannot report timeout
// overflow to the caller, so clamp the timeout to
- // [_PyTime_MIN, _PyTime_MAX].
+ // [PyTime_MIN, PyTime_MAX].
//
- // _PyTime_MAX nanoseconds is around 292.3 years.
+ // PyTime_MAX nanoseconds is around 292.3 years.
//
// _thread.Lock.acquire() and _thread.RLock.acquire() raise an
// OverflowError if microseconds is greater than PY_TIMEOUT_MAX.
_______________________________________________
Python-checkins mailing list -- [email protected]
To unsubscribe send an email to [email protected]
https://mail.python.org/mailman3/lists/python-checkins.python.org/
Member address: [email protected]