Skip to content

Stop using (exposing) deprecated Py_FrozenFlag#2593

Open
Avasam wants to merge 11 commits intomhammond:mainfrom
Avasam:Stop-using-Py_FrozenFlag
Open

Stop using (exposing) deprecated Py_FrozenFlag#2593
Avasam wants to merge 11 commits intomhammond:mainfrom
Avasam:Stop-using-Py_FrozenFlag

Conversation

@Avasam
Copy link
Collaborator

@Avasam Avasam commented Apr 30, 2025

This PR aims to stop using Py_FrozenFlag, solving one of the C API deprecation in #2588

The initial version of this PR does so by deprecating pythoncom.frozen in favor of getattr(sys, "frozen", False).
This is mainly motivated by the side-effect hack importing win32com does on pythoncom.frozen.

An alternative is to give more utility to pythoncom.frozen by officially making it a wrapper to getattr(sys, "frozen", False) allowing users to simply use pythoncom.frozen instead of messing with getattr themselves. But I think it's fair to ask if it's pywin32's job to offer a helper property-like attribute to an optional sys attribute unrelated to Windows ? (if pywin32 uses its own helper though, that's fine).

@Avasam Avasam force-pushed the Stop-using-Py_FrozenFlag branch 3 times, most recently from f5f985d to eaea420 Compare April 30, 2025 21:02
@Avasam Avasam force-pushed the Stop-using-Py_FrozenFlag branch from eaea420 to c3b7b17 Compare April 30, 2025 21:06
@Avasam Avasam requested a review from mhammond April 30, 2025 21:50
@Avasam Avasam force-pushed the Stop-using-Py_FrozenFlag branch from c3b7b17 to 4e6f444 Compare April 30, 2025 23:07
@Avasam Avasam mentioned this pull request May 2, 2025
7 tasks
Sign up for free to 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.

1 participant