Update of /cvsroot/pywin32/pywin32/com/win32com/server
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv26094/win32com/server
Modified Files:
policy.py
Log Message:
If we were asked to create an valid object, but with an IID not supported
by the object, raise a better diagnostic exception.
Index: policy.py
===================================================================
RCS file: /cvsroot/pywin32/pywin32/com/win32com/server/policy.py,v
retrieving revision 1.16
retrieving revision 1.17
diff -C2 -d -r1.16 -r1.17
*** policy.py 24 Nov 2003 09:27:33 -0000 1.16
--- policy.py 12 Mar 2004 08:46:18 -0000 1.17
***************
*** 202,206 ****
myob = call_func(classSpec)
self._wrap_(myob)
! return pythoncom.WrapObject(self, reqIID)
def _wrap_(self, object):
--- 202,214 ----
myob = call_func(classSpec)
self._wrap_(myob)
! try:
! return pythoncom.WrapObject(self, reqIID)
! except pythoncom.com_error, (hr, desc, exc, arg):
! from win32com.util import IIDToInterfaceName
! desc = "The object '%r' was created, but does not support the " \
! "interface '%s'(%s): %s" \
! % (myob, IIDToInterfaceName(reqIID), reqIID, desc)
! raise pythoncom.com_error, (hr, desc, exc, arg)
!
def _wrap_(self, object):
|