Skip to content
Merged
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
19 changes: 15 additions & 4 deletions com/win32com/server/dispatcher.py
Original file line number Diff line number Diff line change
Expand Up @@ -236,6 +236,13 @@ 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

Expand All @@ -246,10 +253,11 @@ class DispatcherWin32dbg(DispatcherBase):
"""

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()
print("The DispatcherWin32dbg dispatcher is deprecated!")
print("Please let me know if this is a problem.")
print("Uncomment the relevant lines in dispatcher.py to re-enable")
# DEBUGGER Note - You can either:
# * Hit Run and wait for a (non Exception class) exception to occur!
# * Set a breakpoint and hit run.
Expand All @@ -258,9 +266,12 @@ def __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, pywin.debugger.dbgcon
import pywin.debugger
import pywin.debugger.dbgcon

debug = 0
try:
raise typ(val)
Expand Down