Skip to content

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