Repository navigation
[SOT][3.8] Cleanup eval_frame python3.9- code - #72868
Conversation
|
你的PR提交成功,感谢你对开源项目的贡献! |
There was a problem hiding this comment.
Pull Request Overview
This PR cleans up legacy Python eval_frame code by removing support for Python versions older than 3.9. It deprecates outdated conditions and macros while simplifying eval_frame callback logic.
- Update the test to require Python 3.9–3.13
- Remove Python 3.8-specific macros and fallback code
- Simplify version-specific branches in eval_frame implementation
Reviewed Changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| test/dygraph_to_static/test_eval_frame.py | Update test condition and comment to reflect new Python version support |
| paddle/fluid/pybind/sot/macros.h | Remove obsolete Python 3.8 definitions and macros |
| paddle/fluid/pybind/sot/guards.cc | Remove fallback implementation for PyObject_CallOneArg for Python below 3.9 |
| paddle/fluid/pybind/sot/eval_frame.c | Eliminate legacy conditional branches for Python versions earlier than 3.9 |
Comments suppressed due to low confidence (2)
paddle/fluid/pybind/sot/eval_frame.c:63
- Add a comment noting that the alternative branch for Python versions below 3.9 has been removed to simplify the eval_frame logic.
return _PyEval_EvalFrameDefault(tstate, frame, throw_flag);
paddle/fluid/pybind/sot/guards.cc:23
- Confirm that the removal of the fallback for PyObject_CallOneArg is intentional and documented elsewhere, given the deprecation of pre-Python 3.9 support.
#if !defined(PyObject_CallOneArg) && !PY_3_9_PLUS
| def test_eval_frame(self): | ||
| if not (sys.version_info >= (3, 8) and sys.version_info < (3, 14)): | ||
| # skip test_eval_frame, current only support 3.8 - 3.13 | ||
| if not (sys.version_info >= (3, 9) and sys.version_info < (3, 14)): |
There was a problem hiding this comment.
[nitpick] Consider updating the inline comment to clearly state that only Python 3.9 to 3.13 are supported. A revision for clarity (eg. 'supported: Python 3.9 to 3.13') could benefit future readers.
| } | ||
|
|
||
| #if PY_3_9_PLUS | ||
| static PyObject *custom_eval_frame_shim(PyThreadState *tstate, |
There was a problem hiding this comment.
这个函数是不是可以删掉了?再把 _custom_eval_frame_shim rename 成 custom_eval_frame_shim
eval_frame python3.9- codeeval_frame python3.9- code
eval_frame python3.9- codeeval_frame python3.9- code
PR Category
Execute Infrastructure
PR Types
Deprecations
Description
eval_framepython3.9- 相关代码