Skip to content

Commit 77430b6

Browse files
authored
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.
1 parent 1235e84 commit 77430b6

File tree

3 files changed

+4
-8
lines changed

3 files changed

+4
-8
lines changed

Include/internal/pycore_time.h

+1-5
Original file line numberDiff line numberDiff line change
@@ -318,10 +318,6 @@ extern int _PyTime_PerfCounterWithInfo(
318318
PyTime_t *t,
319319
_Py_clock_info_t *info);
320320

321-
// Alias for backward compatibility
322-
#define _PyTime_MIN PyTime_MIN
323-
#define _PyTime_MAX PyTime_MAX
324-
325321

326322
// --- _PyDeadline -----------------------------------------------------------
327323

@@ -352,7 +348,7 @@ extern int _PyTimeFraction_Set(
352348
PyTime_t denom);
353349

354350
// Compute ticks * frac.numer / frac.denom.
355-
// Clamp to [_PyTime_MIN; _PyTime_MAX] on overflow.
351+
// Clamp to [PyTime_MIN; PyTime_MAX] on overflow.
356352
extern PyTime_t _PyTimeFraction_Mul(
357353
PyTime_t ticks,
358354
const _PyTimeFraction *frac);

Modules/_threadmodule.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -1948,7 +1948,7 @@ thread_module_exec(PyObject *module)
19481948

19491949
// TIMEOUT_MAX
19501950
double timeout_max = (double)PY_TIMEOUT_MAX * 1e-6;
1951-
double time_max = PyTime_AsSecondsDouble(_PyTime_MAX);
1951+
double time_max = PyTime_AsSecondsDouble(PyTime_MAX);
19521952
timeout_max = Py_MIN(timeout_max, time_max);
19531953
// Round towards minus infinity
19541954
timeout_max = floor(timeout_max);

Python/thread_pthread.h

+2-2
Original file line numberDiff line numberDiff line change
@@ -486,9 +486,9 @@ PyThread_acquire_lock_timed(PyThread_type_lock lock, PY_TIMEOUT_T microseconds,
486486
if (microseconds >= 0) {
487487
// bpo-41710: PyThread_acquire_lock_timed() cannot report timeout
488488
// overflow to the caller, so clamp the timeout to
489-
// [_PyTime_MIN, _PyTime_MAX].
489+
// [PyTime_MIN, PyTime_MAX].
490490
//
491-
// _PyTime_MAX nanoseconds is around 292.3 years.
491+
// PyTime_MAX nanoseconds is around 292.3 years.
492492
//
493493
// _thread.Lock.acquire() and _thread.RLock.acquire() raise an
494494
// OverflowError if microseconds is greater than PY_TIMEOUT_MAX.

0 commit comments

Comments
 (0)