-
Notifications
You must be signed in to change notification settings - Fork 799
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
Cleanup win32comext.axdebug
#2126
Conversation
def TestSmartHelper(): | ||
pdm = pythoncom.CoCreateInstance( | ||
axdebug.CLSID_ProcessDebugManager, | ||
None, | ||
pythoncom.CLSCTX_ALL, | ||
axdebug.IID_IProcessDebugManager, | ||
) | ||
app = pdm.CreateApplication() | ||
app.SetName("Python Process") | ||
|
||
pydebugger = adb.Debugger() | ||
|
||
nodes = BuildModuleTree() | ||
|
||
all_real_nodes = CreateDebugDocumentHelperNodes(pdm, app, nodes) | ||
root = app.GetRootNode() | ||
AttachParentNodes(root, nodes, all_real_nodes) | ||
|
||
pydebugger.AttachApp(app) | ||
cookie = pdm.AddApplication(app) | ||
input("Waiting...") | ||
ttest.test() | ||
|
||
pdm.RemoveApplication(cookie) | ||
print("Done") | ||
|
||
|
||
def testdumb(): | ||
pdm = pythoncom.CoCreateInstance( | ||
axdebug.CLSID_ProcessDebugManager, | ||
None, | ||
pythoncom.CLSCTX_ALL, | ||
axdebug.IID_IProcessDebugManager, | ||
) | ||
app = pdm.GetDefaultApplication() | ||
|
||
nodes = BuildModuleTree() | ||
all_real_nodes = CreateDebugDocumentHelperNodes(pdm, app, nodes) | ||
AttachParentNodes(None, nodes, all_real_nodes) | ||
|
||
parentNode = None | ||
all_real_nodes = {} | ||
input("Waiting...") | ||
print("Done") | ||
|
||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These were commented out in the caller code (so it's unused) and contain a bunch of undefined names / unbound variables that I can't find anywhere.
If you still think it's worth keeping around, I'll comment them out instead.
from win32com.axdebug import axdebug | ||
from win32com.axdebug import axdebug, contexts | ||
from win32com.axdebug.util import _wrap | ||
from win32com.server.exception import Exception | ||
|
||
from . import contexts | ||
from .util import RaiseNotImpl, _wrap | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
PS E:\Users\Avasam\Documents\Git\pywin32\com\win32comext\axdebug> python codecontainer.py
Traceback (most recent call last):
File "E:\Users\Avasam\Documents\Git\pywin32\com\win32comext\axdebug\codecontainer.py", line 19, in <module>
from . import contexts
ImportError: attempted relative import with no known parent package
sys.path.append(".") | ||
import ttest | ||
from Test import ttest |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I tested running this script from both pywin32\com\win32comext\axdebug
and pywin32\com\win32comext\axdebug\Test
. With this change, it finds the module in both cases.
1f5f734
to
831df1a
Compare
@@ -34,7 +33,7 @@ def GetDocument(self): | |||
return self.doc | |||
|
|||
|
|||
class DebugDocumentText(gateways.DebugDocumentInfo, gateways.DebugDocumentText): | |||
class DebugDocumentText(gateways.DebugDocumentText): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
MRO issue, #2071 did not do enough
>>> import win32comext.axdebug.documents
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "C:\Program Files\Python39\lib\site-packages\win32comext\axdebug\documents.py", line 37, in <module>
class DebugDocumentText(
TypeError: Cannot create a consistent method resolution
order (MRO) for bases DebugDocumentInfo, DebugDocumentText
from win32com.server.util import unwrap | ||
|
||
print("Wrapped items:") | ||
for key, items in all_wrapped.items(): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nothing ever modifies all_wrapped
. Meaning this code likely does nothing.
831df1a
to
34ffcad
Compare
34ffcad
to
a041c13
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks!
This is the combination of the following changes, but scoped specifically to the
win32comext.axdebug
module:format_all.bat
Merging this first will reduce changes everywhere else.
Non-obvious changes are clarified in comments.