diff options
| author | Victor Stinner <vstinner@python.org> | 2020-11-16 15:08:05 (GMT) |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2020-11-16 15:08:05 (GMT) |
| commit | ae6cd7cfdab0599139002c526953d907696d9eef (patch) | |
| tree | fbfcfd94f1f73fa6e38a50dc5112a707e59d4c6b /Python/pylifecycle.c | |
| parent | 5909a494cd3ba43143b28bd439773ed85a485dfc (diff) | |
| download | cpython-ae6cd7cfdab0599139002c526953d907696d9eef.zip cpython-ae6cd7cfdab0599139002c526953d907696d9eef.tar.gz cpython-ae6cd7cfdab0599139002c526953d907696d9eef.tar.bz2 | |
bpo-37205: time.time() cannot fail with fatal error (GH-23314)
time.time(), time.perf_counter() and time.monotonic() functions can
no longer fail with a Python fatal error, instead raise a regular
Python exception on failure.
Remove _PyTime_Init(): don't check system, monotonic and perf counter
clocks at startup anymore.
On error, _PyTime_GetSystemClock(), _PyTime_GetMonotonicClock() and
_PyTime_GetPerfCounter() now silently ignore the error and return 0.
They cannot fail with a Python fatal error anymore.
Add py_mach_timebase_info() and win_perf_counter_frequency()
sub-functions.
Diffstat (limited to 'Python/pylifecycle.c')
| -rw-r--r-- | Python/pylifecycle.c | 6 |
1 files changed, 0 insertions, 6 deletions
diff --git a/Python/pylifecycle.c b/Python/pylifecycle.c index 2d43e01..33deafb 100644 --- a/Python/pylifecycle.c +++ b/Python/pylifecycle.c @@ -763,12 +763,6 @@ pycore_interp_init(PyThreadState *tstate) goto done; } - if (_Py_IsMainInterpreter(tstate)) { - if (_PyTime_Init() < 0) { - return _PyStatus_ERR("can't initialize time"); - } - } - status = _PySys_Create(tstate, &sysmod); if (_PyStatus_EXCEPTION(status)) { goto done; |
