Skip to content

bpo-46850: Remove _PyEval_GetCoroutineOriginTrackingDepth() #32018

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Mar 21, 2022
Merged

bpo-46850: Remove _PyEval_GetCoroutineOriginTrackingDepth() #32018

merged 1 commit into from
Mar 21, 2022

Conversation

vstinner
Copy link
Member

@vstinner vstinner commented Mar 21, 2022

Remove the private undocumented function
_PyEval_GetCoroutineOriginTrackingDepth() from the C API. Call the
public sys.get_coroutine_origin_tracking_depth() function
instead.

Change the internal function
_PyEval_SetCoroutineOriginTrackingDepth():

  • Remove the 'tstate' parameter;
  • Add return value and raises an exception if depth is negative;
  • No longer export the function: call the public
    sys.set_coroutine_origin_tracking_depth() function instead.

Uniformize also function declarations in pycore_ceval.h.

https://bugs.python.org/issue46850

@vstinner
Copy link
Member Author

sys.get_coroutine_origin_tracking_depth() and sys.set_coroutine_origin_tracking_depth() are tested by test_coroutines.

This PR doesn't impact any project of the top 5000 PyPI projects:

$ ./search_pypi_top.py PYPI-2022-01-26-TOP-5000/ '_PyEval_GetCoroutineOriginTrackingDepth|_PyEval_SetCoroutineOriginTrackingDepth' -q

Found 0 matching lines in 0 projects

Remove the private undocumented function
_PyEval_GetCoroutineOriginTrackingDepth() from the C API. Call the
public sys.get_coroutine_origin_tracking_depth() function instead.

Change the internal function
_PyEval_SetCoroutineOriginTrackingDepth():

* Remove the 'tstate' parameter;
* Add return value and raises an exception if depth is negative;
* No longer export the function: call the public
  sys.set_coroutine_origin_tracking_depth() function instead.

Uniformize also function declarations in pycore_ceval.h.
@vstinner vstinner merged commit 9087243 into python:main Mar 21, 2022
@vstinner vstinner deleted the pyeval_origin branch March 21, 2022 01:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants