From 37875dde423b03b0cc80a5cc8f0e7501679daaec Mon Sep 17 00:00:00 2001 From: Thomas Geppert Date: Tue, 15 Oct 2024 03:31:09 +0200 Subject: [PATCH] Check for the class attribute 'CLSID' instead of the instance attribute (#2353) to decide if building makepy support is required. --- com/win32com/client/gencache.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/com/win32com/client/gencache.py b/com/win32com/client/gencache.py index e64449b8b..717f2a9c7 100644 --- a/com/win32com/client/gencache.py +++ b/com/win32com/client/gencache.py @@ -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]