Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
3 changes: 2 additions & 1 deletion CHANGES.txt
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,8 @@ https://mhammond.github.io/pywin32_installers.html .

Coming in build 310, as yet unreleased
--------------------------------------
* Drop support for Vista, set Windows 7 as the minimal Windows version. (#, @Avasam)
* Fixed a regression where `win32com.client.DispatchWithEvents` and win32com.client.WithEvents` would throw a `TypeError` on the second call (#2489, @Avasam)
* Drop support for Vista, set Windows 7 as the minimal Windows version. (#2487, @Avasam)
* Restores many IIDs in `win32com(ext).shell.shell`. See #2486 for details.
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The indentation of this line looks wrong now there are other entries - should it be dedented?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I meant for it to be a precision. But I could rewrite as "2 entries, added by the same changeset" like this:

Suggested change
* Restores many IIDs in `win32com(ext).shell.shell`. See #2486 for details.
* Restored many IIDs in `win32com(ext).shell.shell`. See #2486 for details. (#2487, @Avasam)

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That "sub item" is more important imo - so maybe it should also move up and note it's a regression? code using win32com.shell is likely broken, right?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Feel free to reorganize the changelog to your likings if you want keep more important stuff at the top. You have the final say on those before releases ^^


Build 309, released 2025/03/09
Expand Down
3 changes: 1 addition & 2 deletions com/win32com/client/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -269,7 +269,7 @@ def __get_disp_and_event_classes(dispatch):
disp = Dispatch(dispatch)

if disp.__class__.__dict__.get("CLSID"):
return disp.__class__
disp_class = disp.__class__

# Eeek - no makepy support - try and build it.
error_msg = "This COM object can not automate the makepy process - please run makepy manually for this object"
Expand Down Expand Up @@ -333,7 +333,6 @@ class object that derives from three classes:
>>> ie = DispatchWithEvents("InternetExplorer.Application", IEEvents)
>>> ie.Visible = 1
Visible changed: 1
>>>
"""
disp, disp_class, events_class = __get_disp_and_event_classes(clsid)
result_class = type(
Expand Down
7 changes: 7 additions & 0 deletions com/win32com/test/testPyComTest.py
Original file line number Diff line number Diff line change
Expand Up @@ -628,6 +628,13 @@ def TestGenerated():
# and a plain "WithEvents".
handler = win32com.client.WithEvents(o, RandomEventHandler)
TestEvents(o, handler)

# Ensure that if it has already been dispatched, the base classes are the same.
o2_again = win32com.client.DispatchWithEvents(o, RandomEventHandler)
assert o2._obj_.__class__.__bases__ == o2_again._obj_.__class__.__bases__
handler_again = win32com.client.WithEvents(o, RandomEventHandler)
assert handler.__class__.__bases__ == handler_again.__class__.__bases__

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In hindsight, this is already tested by the lines above. So it's really just that the test doesn't run on CI...

Suggested change
# Ensure that if it has already been dispatched, the base classes are the same.
o2_again = win32com.client.DispatchWithEvents(o, RandomEventHandler)
assert o2._obj_.__class__.__bases__ == o2_again._obj_.__class__.__bases__
handler_again = win32com.client.WithEvents(o, RandomEventHandler)
assert handler.__class__.__bases__ == handler_again.__class__.__bases__

progress("Finished generated .py test.")


Expand Down