Skip to content

Inline _Py_RestoreSignals() from CPython - #604

Merged
fantix merged 2 commits into
MagicStack:masterfrom
befeleme:restore-signals
Aug 15, 2024
Merged

Inline _Py_RestoreSignals() from CPython#604
fantix merged 2 commits into
MagicStack:masterfrom
befeleme:restore-signals

Conversation

@befeleme

Copy link
Copy Markdown
Contributor

private _Py_RestoreSignals() has been moved to CPython internals as of Python 3.13 See: python/cpython#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

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

Copy link
Copy Markdown

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).

@edgarrmondragonedgarrmondragon mentioned this pull request Jul 5, 2024

@fantixfantix left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@fantix
fantix merged commit 8511ba1 into MagicStack:masterAug 15, 2024
fantix added a commit that referenced this pull request Aug 15, 2024
Changes
=======
* Upgrade libuv to v1.48.0 (#600)
(by @niklasr22@fantix in 7777852 for #596#615)
Fixes
=====
* Fix test_create_server_4 with Python 3.12.5 (#614)
(by @shadchin in 62f9239)
* Use len(os.sched_getaffinity(0)) instead of os.cpu_count() (#591)
(by @avkarenow in c8531c2 for #591)
* Inline _Py_RestoreSignals() from CPython (#604)
(by @befeleme in 8511ba1 for #603)
@fantixfantix mentioned this pull request Aug 15, 2024
@befeleme
befeleme deleted the restore-signals branch August 20, 2024 08:05
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

uvloop fails to build with Python 3.13.0a5: error: implicit declaration of function ‘_Py_RestoreSignals’

3 participants

@befeleme@tacaswell@fantix