55import pythoncom
66from win32com .client import gencache
77
8- com_error = pythoncom .com_error
9- _univgw = pythoncom ._univgw
8+ com_error = pythoncom .com_error # Re-exported alias
109
1110
1211def RegisterInterfaces (typelibGUID , lcid , major , minor , interface_names = None ):
@@ -86,15 +85,15 @@ def RegisterInterfaces(typelibGUID, lcid, major, minor, interface_names=None):
8685
8786def _doCreateVTable (iid , interface_name , is_dispatch , method_defs ):
8887 defn = Definition (iid , is_dispatch , method_defs )
89- vtbl = _univgw .CreateVTable (defn , is_dispatch )
90- _univgw .RegisterVTable (vtbl , iid , interface_name )
88+ vtbl = pythoncom . _univgw .CreateVTable (defn , is_dispatch )
89+ pythoncom . _univgw .RegisterVTable (vtbl , iid , interface_name )
9190
9291
9392def _CalcTypeSize (typeTuple ):
9493 t = typeTuple [0 ]
9594 if t & (pythoncom .VT_BYREF | pythoncom .VT_ARRAY ):
9695 # It's a pointer.
97- cb = _univgw .SizeOfVT (pythoncom .VT_PTR )[1 ]
96+ cb = pythoncom . _univgw .SizeOfVT (pythoncom .VT_PTR )[1 ]
9897 elif t == pythoncom .VT_RECORD :
9998 # Just because a type library uses records doesn't mean the user
10099 # is trying to. We need to better place to warn about this, but it
@@ -104,10 +103,10 @@ def _CalcTypeSize(typeTuple):
104103 # warnings.warn("warning: records are known to not work for vtable interfaces")
105104 # except ImportError:
106105 # print("warning: records are known to not work for vtable interfaces")
107- cb = _univgw .SizeOfVT (pythoncom .VT_PTR )[1 ]
106+ cb = pythoncom . _univgw .SizeOfVT (pythoncom .VT_PTR )[1 ]
108107 # cb = typeInfo.GetTypeAttr().cbSizeInstance
109108 else :
110- cb = _univgw .SizeOfVT (t )[1 ]
109+ cb = pythoncom . _univgw .SizeOfVT (t )[1 ]
111110 return cb
112111
113112
@@ -191,8 +190,8 @@ def dispatch(
191190 ob ,
192191 index ,
193192 argPtr ,
194- ReadFromInTuple = _univgw .ReadFromInTuple ,
195- WriteFromOutTuple = _univgw .WriteFromOutTuple ,
193+ ReadFromInTuple = pythoncom . _univgw .ReadFromInTuple ,
194+ WriteFromOutTuple = pythoncom . _univgw .WriteFromOutTuple ,
196195 ):
197196 "Dispatch a call to an interface method."
198197 meth = self ._methods [index ]
0 commit comments