From 935dfe5d9347889efad99af4c5f104ba07d4e773 Mon Sep 17 00:00:00 2001 From: Avasam Date: Sun, 6 Oct 2024 11:11:03 -0400 Subject: [PATCH 1/3] Remove long-deprecated `win32com.server.dispatcher.DispatcherWin32dbg` --- CHANGES.txt | 1 + com/win32com/server/dispatcher.py | 58 ------------------------------- 2 files changed, 1 insertion(+), 58 deletions(-) diff --git a/CHANGES.txt b/CHANGES.txt index 497361adfe..14a59a9ac3 100644 --- a/CHANGES.txt +++ b/CHANGES.txt @@ -15,6 +15,7 @@ Coming in build 308, as yet unreleased -------------------------------------- * Fixed a circular import between `win32comext.axscript.client.framework` and `win32comext.axscript.client.error` (#2381, @Avasam) +* Remove long-deprecated `win32com.server.dispatcher.DispatcherWin32dbg` (#, @Avasam) Build 307, released 2024-10-04 ------------------------------ diff --git a/com/win32com/server/dispatcher.py b/com/win32com/server/dispatcher.py index 95791a3554..25ad6465b4 100644 --- a/com/win32com/server/dispatcher.py +++ b/com/win32com/server/dispatcher.py @@ -236,64 +236,6 @@ def _trace_(self, *args): win32api.OutputDebugString(str(args[-1]) + "\n") -DispatcherWin32dbg_deprecation_message = """\ -The DispatcherWin32dbg dispatcher is deprecated! -Please open an issue at https://github.com/mhammond/pywin32 is this is a problem. -Comment the relevant DeprecationWarning in dispatcher.py to re-enable.\ -""" - - -class DispatcherWin32dbg(DispatcherBase): - """A source-level debugger dispatcher - - A dispatcher which invokes the debugger as an object is instantiated, or - when an unexpected exception occurs. - - Requires Pythonwin. - """ - - def __init__(self, policyClass, ob): - raise DeprecationWarning(DispatcherWin32dbg_deprecation_message) - # No one uses this, and it just causes py2exe to drag all of pythonwin in. - import pywin.debugger - - pywin.debugger.brk() - # DEBUGGER Note - You can either: - # * Hit Run and wait for a (non Exception class) exception to occur! - # * Set a breakpoint and hit run. - # * Step into the object creation (a few steps away!) - DispatcherBase.__init__(self, policyClass, ob) - - def _HandleException_(self): - """Invoke the debugger post mortem capability""" - raise DeprecationWarning(DispatcherWin32dbg_deprecation_message) - # Save details away. - typ, val, tb = exc_info() - import pywin.debugger - import pywin.debugger.dbgcon - - debug = 0 - try: - raise typ(val) - except Exception: # AARG - What is this Exception??? - # Use some inside knowledge to borrow a Debugger option which dictates if we - # stop at "expected" exceptions. - debug = pywin.debugger.GetDebugger().get_option( - pywin.debugger.dbgcon.OPT_STOP_EXCEPTIONS - ) - except: - debug = 1 - if debug: - try: - pywin.debugger.post_mortem(tb, typ, val) # The original exception - except: - traceback.print_exc() - - # But still raise it. - del tb - raise - - try: import win32trace From c59f403075ad52342b0450b966e7357dd26e44fe Mon Sep 17 00:00:00 2001 From: Avasam Date: Sun, 6 Oct 2024 11:12:34 -0400 Subject: [PATCH 2/3] Add PR number to change entry --- CHANGES.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGES.txt b/CHANGES.txt index 14a59a9ac3..eea52c8eb8 100644 --- a/CHANGES.txt +++ b/CHANGES.txt @@ -15,7 +15,7 @@ Coming in build 308, as yet unreleased -------------------------------------- * Fixed a circular import between `win32comext.axscript.client.framework` and `win32comext.axscript.client.error` (#2381, @Avasam) -* Remove long-deprecated `win32com.server.dispatcher.DispatcherWin32dbg` (#, @Avasam) +* Remove long-deprecated `win32com.server.dispatcher.DispatcherWin32dbg` (#2382, @Avasam) Build 307, released 2024-10-04 ------------------------------ From 2191958a7d8f90aa990cb00b4ae05aeca1bf8efe Mon Sep 17 00:00:00 2001 From: Avasam Date: Sun, 6 Oct 2024 11:22:38 -0400 Subject: [PATCH 3/3] Run pycln --- com/win32com/server/dispatcher.py | 1 - 1 file changed, 1 deletion(-) diff --git a/com/win32com/server/dispatcher.py b/com/win32com/server/dispatcher.py index 25ad6465b4..241edfef89 100644 --- a/com/win32com/server/dispatcher.py +++ b/com/win32com/server/dispatcher.py @@ -6,7 +6,6 @@ from __future__ import annotations import traceback -from sys import exc_info import pythoncom import win32api