[ctypes-commit] ctypes/comtypes __init__.py,1.19,1.20
Brought to you by:
theller
From: Thomas H. <th...@us...> - 2005-03-11 17:34:34
|
Update of /cvsroot/ctypes/ctypes/comtypes In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv23013 Modified Files: __init__.py Log Message: Make sure that the base interface already has it's _methods_ defined when _methods_ is set. Index: __init__.py =================================================================== RCS file: /cvsroot/ctypes/ctypes/comtypes/__init__.py,v retrieving revision 1.19 retrieving revision 1.20 diff -C2 -d -r1.19 -r1.20 *** __init__.py 11 Mar 2005 15:38:15 -0000 1.19 --- __init__.py 11 Mar 2005 17:34:23 -0000 1.20 *************** *** 109,114 **** def __get_baseinterface_methodcount(self): "Return the number of com methods in the base interfaces" ! return sum([len(itf.__dict__.get("_methods_", ())) ! for itf in self.__mro__[1:]]) def _make_methods(self, methods): --- 109,119 ---- def __get_baseinterface_methodcount(self): "Return the number of com methods in the base interfaces" ! try: ! return sum([len(itf.__dict__["_methods_"]) ! for itf in self.__mro__[1:-1]]) ! except KeyError, (name,): ! if name == "_methods_": ! raise TypeError, "baseinterface '%s' has no _methods_" % itf.__name__ ! raise def _make_methods(self, methods): |