Skip to content

[3.15] gh-152132: Fix bugs in Py_RunMain() (#153461)#153466

Merged
vstinner merged 2 commits into
python:3.15from
vstinner:pymain_fixes15
Jul 10, 2026
Merged

[3.15] gh-152132: Fix bugs in Py_RunMain() (#153461)#153466
vstinner merged 2 commits into
python:3.15from
vstinner:pymain_fixes15

Conversation

@vstinner

@vstinner vstinner commented Jul 9, 2026

Copy link
Copy Markdown
Member
  • Check for signals more often. Previously, a pending exception could be removed by PyErr_Clear().
  • Only call _PyInterpreterState_SetNotRunningMain() if _PyInterpreterState_SetRunningMain() has been called.
  • Convert _PyPathConfig_UpdateGlobal() PyStatus error to an exception.

* Check for signals more often. Previously, a pending exception could
  be removed by PyErr_Clear().
* Only call _PyInterpreterState_SetNotRunningMain() if
  _PyInterpreterState_SetRunningMain() has been called.
* Convert _PyPathConfig_UpdateGlobal() PyStatus error to an
  exception.
@vstinner vstinner enabled auto-merge (squash) July 9, 2026 23:42
@vstinner vstinner merged commit cecafeb into python:3.15 Jul 10, 2026
50 checks passed
@vstinner vstinner deleted the pymain_fixes15 branch July 10, 2026 00:18
@miss-islington-app

Copy link
Copy Markdown

Thanks @vstinner for the PR 🌮🎉.. I'm working now to backport this PR to: 3.13, 3.14.
🐍🍒⛏🤖

@bedevere-app

bedevere-app Bot commented Jul 10, 2026

Copy link
Copy Markdown

GH-153467 is a backport of this pull request to the 3.14 branch.

@bedevere-app bedevere-app Bot removed the needs backport to 3.14 bugs and security fixes label Jul 10, 2026
@bedevere-app

bedevere-app Bot commented Jul 10, 2026

Copy link
Copy Markdown

GH-153468 is a backport of this pull request to the 3.13 branch.

@bedevere-app bedevere-app Bot removed the needs backport to 3.13 bugs and security fixes label Jul 10, 2026
vstinner added a commit that referenced this pull request Jul 10, 2026
…153468)

[3.15] gh-152132: Fix bugs in Py_RunMain() (GH-153461) (GH-153466)

* Check for signals more often. Previously, a pending exception could
  be removed by PyErr_Clear().
* Only call _PyInterpreterState_SetNotRunningMain() if
  _PyInterpreterState_SetRunningMain() has been called.
* Convert _PyPathConfig_UpdateGlobal() PyStatus error to an
  exception.
(cherry picked from commit cecafeb)

Co-authored-by: Victor Stinner <vstinner@python.org>
vstinner added a commit that referenced this pull request Jul 10, 2026
…153467)

[3.15] gh-152132: Fix bugs in Py_RunMain() (GH-153461) (GH-153466)

* Check for signals more often. Previously, a pending exception could
  be removed by PyErr_Clear().
* Only call _PyInterpreterState_SetNotRunningMain() if
  _PyInterpreterState_SetRunningMain() has been called.
* Convert _PyPathConfig_UpdateGlobal() PyStatus error to an
  exception.
(cherry picked from commit cecafeb)

Co-authored-by: Victor Stinner <vstinner@python.org>
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.

1 participant