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

Remove temporary win32com.server.policy reexports hack marked for removal over 25 years ago #2344

Merged
Show file tree
Hide file tree
Changes from 3 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
2 changes: 2 additions & 0 deletions CHANGES.txt
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@ https://mhammond.github.io/pywin32_installers.html.
Coming in build 309, as yet unreleased
--------------------------------------

* Remove temporary `win32com.server.policy` reexports hack (#2344, @Avasam)
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think there's a need for a changelog entry here - we should only add them for things people might possibly notice.

Copy link
Collaborator Author

@Avasam Avasam Oct 13, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Some very old code could reference win32com.server.policy.DispatcherWin32trace or win32com.server.policy.DispatcherTrace. I could make that clearer in the changelog. Or remove the change entry entirely if you still prefer that.

Suggested change
* Remove temporary `win32com.server.policy` reexports hack (#2344, @Avasam)
* Remove temporary `win32com.server.policy` reexports hack (#2344, @Avasam)
Import `DispatcherWin32trace` and `DispatcherTrace` from `win32com.server.dispatcher` instead.

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fair enough, a note makes sense then


Build 308, released 2024-10-12
------------------------------
* Fix Pythonwin displaying syntax errors in Python 3.13 (#2393)
Expand Down
12 changes: 0 additions & 12 deletions com/win32com/server/policy.py
Original file line number Diff line number Diff line change
Expand Up @@ -803,15 +803,3 @@ def _import_module(mname):
# Eeek - result of _import_ is "win32com" - not "win32com.a.b.c"
# Get the full module from sys.modules
return sys.modules[mname]


#######
#
# Temporary hacks until all old code moves.
#
# These have been moved to a new source file, but some code may
# still reference them here. These will end up being removed.
try:
from .dispatcher import DispatcherTrace, DispatcherWin32trace
except ImportError: # Quite likely a frozen executable that doesn't need dispatchers
pass
5 changes: 3 additions & 2 deletions com/win32comext/axdebug/util.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
import sys

import win32api
import win32com.server.dispatcher
import win32com.server.policy
import win32com.server.util
import winerror
Expand Down Expand Up @@ -58,9 +59,9 @@ def RaiseNotImpl(who=None):
raise COMException(scode=winerror.E_NOTIMPL)


class Dispatcher(win32com.server.policy.DispatcherWin32trace):
class Dispatcher(win32com.server.dispatcher.DispatcherWin32trace):
def __init__(self, policyClass, object):
win32com.server.policy.DispatcherTrace.__init__(self, policyClass, object)
win32com.server.dispatcher.DispatcherTrace.__init__(self, policyClass, object)
import win32traceutil # Sets up everything.

# print(f"Object with win32trace dispatcher created ({object})")
Expand Down
Loading