Skip to content

Commit 194bac9

Browse files
kxrobAvasam
authored andcommitted
Fix dispid caching in dynamic.CDispatch.__getattr__
Property 'dispid's only found by __AttrToID__() / GetIDsOfNames() were not cached in propMap and caused time consuming search upon every read.
1 parent 8412f31 commit 194bac9

1 file changed

Lines changed: 1 addition & 0 deletions

File tree

com/win32com/client/dynamic.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -599,6 +599,7 @@ def __call__(self):
599599
retEntry = self._olerepr_.propMapGet.get(attr)
600600
if retEntry is None:
601601
retEntry = build.MapEntry(self.__AttrToID__(attr), (attr,))
602+
self._olerepr_.propMap[attr] = retEntry
602603
except pythoncom.ole_error:
603604
pass # No prop by that name - retEntry remains None.
604605

0 commit comments

Comments
 (0)