MagicStack / uvloop

Ultra fast asyncio event loop.
Apache License 2.0
10.45k stars 548 forks source link

Inline _Py_RestoreSignals() from CPython #604

Closed befeleme closed 3 months ago

befeleme commented 7 months ago

private _Py_RestoreSignals() has been moved to CPython internals as of Python 3.13 See: https://github.com/python/cpython/pull/106400 Its implementation has been the same in all supported by uvloop Pythons (3.8+), so the inlining was not conditionalized.

Closes #603

This allows to build uvloop with Python 3.13.0a6.

Unfortunately, one of the tests fails and I can't tell whether it's related to this or it's an incidental breakage coming from some other parts of CPython changes:

=================================== FAILURES ===================================
___________________ Test_AIO_Unix.test_create_unix_server_1 ____________________
Traceback (most recent call last):
  File "/usr/lib64/python3.13/unittest/case.py", line 58, in testPartExecutor
    yield
  File "/usr/lib64/python3.13/unittest/case.py", line 651, in run
    self._callTestMethod(testMethod)
    ~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^
  File "/usr/lib64/python3.13/unittest/case.py", line 606, in _callTestMethod
    if method() is not None:
       ~~~~~~^^
  File "/builddir/build/BUILD/uvloop-0.19.0/_empty/tests/test_unix.py", line 147, in test_create_unix_server_1
    self.loop.run_until_complete(start_server())
    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^
  File "/usr/lib64/python3.13/asyncio/base_events.py", line 721, in run_until_complete
    return future.result()
           ~~~~~~~~~~~~~^^
  File "/builddir/build/BUILD/uvloop-0.19.0/_empty/tests/test_unix.py", line 100, in start_server
    self.assertTrue(os.path.exists(sock_name))
    ~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib64/python3.13/unittest/case.py", line 744, in assertTrue
    raise self.failureException(msg)
AssertionError: False is not true
tacaswell commented 4 months ago

I can confirm that this works with the 3.13 branch of cpython + the cython default branch (if the cython pinning in setup.py is removed).