Skip to content

Commit

Permalink
Check for the class attribute 'CLSID' instead of the instance attribu…
Browse files Browse the repository at this point in the history
…te (#2353)

to decide if building makepy support is required.
  • Loading branch information
geppi authored Oct 15, 2024
1 parent 41da8be commit 37875dd
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion com/win32com/client/gencache.py
Original file line number Diff line number Diff line change
Expand Up @@ -626,7 +626,7 @@ def EnsureDispatch(
): # New fn, so we default the new demand feature to on!
"""Given a COM prog_id, return an object that is using makepy support, building if necessary"""
disp = win32com.client.Dispatch(prog_id)
if not disp.__dict__.get("CLSID"): # Eeek - no makepy support - try and build it.
if not hasattr(disp, "CLSID"): # Eeek - no makepy support - try and build it.
try:
ti = disp._oleobj_.GetTypeInfo()
disp_clsid = ti.GetTypeAttr()[0]
Expand Down

0 comments on commit 37875dd

Please sign in to comment.