Skip to content

Commit 37875dd

Browse files
authored
Check for the class attribute 'CLSID' instead of the instance attribute (#2353)
to decide if building makepy support is required.
1 parent 41da8be commit 37875dd

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

com/win32com/client/gencache.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -626,7 +626,7 @@ def EnsureDispatch(
626626
): # New fn, so we default the new demand feature to on!
627627
"""Given a COM prog_id, return an object that is using makepy support, building if necessary"""
628628
disp = win32com.client.Dispatch(prog_id)
629-
if not disp.__dict__.get("CLSID"): # Eeek - no makepy support - try and build it.
629+
if not hasattr(disp, "CLSID"): # Eeek - no makepy support - try and build it.
630630
try:
631631
ti = disp._oleobj_.GetTypeInfo()
632632
disp_clsid = ti.GetTypeAttr()[0]

0 commit comments

Comments
 (0)