Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix System Error on Python 3.13 and Windows (#457)
Fixes #456. The relevant crash from the test log actually seems to be the initial failure: ``` AttributeError: module 'time' has no attribute 'clock_gettime_ns' The above exception was the direct cause of the following exception: ... > _time_machine.patch_if_needed() E SystemError: <built-in function patch_if_needed> returned a result with an exception set ``` `PyObject_GetAttrString` fails to get `clock_gettime` and `clock_gettime_ns` on Windows because they only exist on Unix. It returns `NULL` and each time sets the `AttributeError` as the current error. `patch_if_needed` did not clear this, leading to Python's call check to raise a `SystemError` caused by the `AttributeError`, making time-machine fail to start travelling. I'm not sure which exact change in Python made this failure occur, so far it seems the `SystemError` should have been raised on older versions too. Ah well.
- Loading branch information