Skip to content

Commit c670569

Browse files
authored
Remove temporary win32com.server.policy reexports hack marked for removal over 25 years ago (#2344)
1 parent a6ca37a commit c670569

3 files changed

Lines changed: 5 additions & 14 deletions

File tree

CHANGES.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,8 @@ https://mhammond.github.io/pywin32_installers.html.
1414
Coming in build 309, as yet unreleased
1515
--------------------------------------
1616

17+
* Remove temporary `win32com.server.policy` reexports hack (#2344, @Avasam)
18+
Import `DispatcherWin32trace` and `DispatcherTrace` from `win32com.server.dispatcher` instead.
1719
* Fixed `win32timezone.TimeZoneInfo` initialization from a `[DYNAMIC_]TIME_ZONE_INFORMATION` (#2339, @Avasam)
1820
* Added runtime deprecation warning of `win2kras`, use `win32ras` instead (#2356, @Avasam)
1921
* Improved handling of dict iterations and fallbacks (removes Python 2 support code, small general speed improvement) (#2332, #2330, @Avasam)

com/win32com/server/policy.py

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -801,15 +801,3 @@ def _import_module(mname):
801801
# Eeek - result of _import_ is "win32com" - not "win32com.a.b.c"
802802
# Get the full module from sys.modules
803803
return sys.modules[mname]
804-
805-
806-
#######
807-
#
808-
# Temporary hacks until all old code moves.
809-
#
810-
# These have been moved to a new source file, but some code may
811-
# still reference them here. These will end up being removed.
812-
try:
813-
from .dispatcher import DispatcherTrace, DispatcherWin32trace
814-
except ImportError: # Quite likely a frozen executable that doesn't need dispatchers
815-
pass

com/win32comext/axdebug/util.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
import sys
66

77
import win32api
8+
import win32com.server.dispatcher
89
import win32com.server.policy
910
import win32com.server.util
1011
import winerror
@@ -54,9 +55,9 @@ def RaiseNotImpl(who=None):
5455
raise COMException(scode=winerror.E_NOTIMPL)
5556

5657

57-
class Dispatcher(win32com.server.policy.DispatcherWin32trace):
58+
class Dispatcher(win32com.server.dispatcher.DispatcherWin32trace):
5859
def __init__(self, policyClass, object):
59-
win32com.server.policy.DispatcherTrace.__init__(self, policyClass, object)
60+
win32com.server.dispatcher.DispatcherTrace.__init__(self, policyClass, object)
6061
import win32traceutil # Sets up everything.
6162

6263
# print(f"Object with win32trace dispatcher created ({object})")

0 commit comments

Comments
 (0)