Cleanup win32comext.axdebug#2126
Merged
mhammond merged 5 commits intomhammond:mainfrom Nov 1, 2023
Merged
Conversation
Avasam
commented
Sep 22, 2023
Comment on lines
-112
to
-156
| 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") | ||
|
|
||
|
|
Collaborator
Author
There was a problem hiding this comment.
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.
Avasam
commented
Sep 22, 2023
Comment on lines
-12
to
-17
| 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 | ||
|
|
Collaborator
Author
There was a problem hiding this comment.
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
Avasam
commented
Sep 22, 2023
Comment on lines
-256
to
+255
| sys.path.append(".") | ||
| import ttest | ||
| from Test import ttest |
Collaborator
Author
There was a problem hiding this comment.
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
Avasam
commented
Sep 22, 2023
|
|
||
|
|
||
| class DebugDocumentText(gateways.DebugDocumentInfo, gateways.DebugDocumentText): | ||
| class DebugDocumentText(gateways.DebugDocumentText): |
Collaborator
Author
There was a problem hiding this comment.
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
Avasam
commented
Sep 22, 2023
| from win32com.server.util import unwrap | ||
|
|
||
| print("Wrapped items:") | ||
| for key, items in all_wrapped.items(): |
Collaborator
Author
There was a problem hiding this comment.
Nothing ever modifies all_wrapped. Meaning this code likely does nothing.
831df1a to
34ffcad
Compare
Avasam
commented
Sep 22, 2023
Avasam
commented
Sep 22, 2023
Avasam
commented
Sep 22, 2023
34ffcad to
a041c13
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This is the combination of the following changes, but scoped specifically to the
win32comext.axdebugmodule:format_all.batMerging this first will reduce changes everywhere else.
Non-obvious changes are clarified in comments.