Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Runtime deprecation of win2kras #2356

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 14 additions & 7 deletions win32/Lib/win2kras.py
Original file line number Diff line number Diff line change
@@ -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)
12 changes: 2 additions & 10 deletions win32/winxpgui.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Loading