diff --git a/CHANGES.txt b/CHANGES.txt index 0e7a52654..c76daddd8 100644 --- a/CHANGES.txt +++ b/CHANGES.txt @@ -14,6 +14,7 @@ https://mhammond.github.io/pywin32_installers.html. Coming in build 309, as yet unreleased -------------------------------------- +* Add runtime deprecation warning of `win2kras`, use `win32ras` instead (#2356, @Avasam) * Improved handling of dict iterations and fallbacks (removes Python 2 support code, small general speed improvement) (#2332, #2330, @Avasam) * Fixed "Open GL Demo" (`Pythonwin/pywin/Demos/openGLDemo.py`) and restore "Font" demo in `Pythonwin/pywin/Demos/guidemo.py` (#2345, @Avasam) * Fixed accidentally trying to raise an undefined name instead of an `Exception` in `Pythonwin/pywin/debugger/debugger.py` (#2326, @Avasam) diff --git a/win32/Lib/win2kras.py b/win32/Lib/win2kras.py index f1c18b3ac..9e3724811 100644 --- a/win32/Lib/win2kras.py +++ b/win32/Lib/win2kras.py @@ -1,7 +1,14 @@ -# win2kras used to be an extension module with wrapped the "new" RAS functions -# in Windows 2000, so win32ras could still be used on NT/etc. -# I think in 2021 we can be confident pywin32 is not used on earlier OSs, so -# that functionality is now in win32ras. -# -# This exists just to avoid breaking old scripts. -from win32ras import * +"""\ +win2kras used to be an extension module with wrapped the "new" RAS functions \ +in Windows 2000, so win32ras could still be used on NT/etc. +I think in 2021 we can be confident pywin32 is not used on earlier OSs, so \ +that functionality is now in win32ras. + +This exists just to avoid breaking old scripts.\ +""" + +import warnings + +from win32ras import * # nopycln: import + +warnings.warn(str(__doc__), category=DeprecationWarning) diff --git a/win32/winxpgui.py b/win32/winxpgui.py index 7935e96ff..e27fd58b9 100644 --- a/win32/winxpgui.py +++ b/win32/winxpgui.py @@ -3,19 +3,11 @@ by `win32gui` and `win32console.GetConsoleWindow`. Use those instead. \ """ -from __future__ import annotations - import warnings -from win32console import ( +from win32console import ( # nopycln: import GetConsoleWindow as GetConsoleWindow, # noqa: PLC0414 # Explicit re-export ) from win32gui import * -warnings.warn( - """\ -The `winxpgui` module is obsolete and has been completely replaced \ -by `win32gui` and `win32console.GetConsoleWindow`. Use those instead. \ -""", - category=DeprecationWarning, -) +warnings.warn(str(__doc__), category=DeprecationWarning)