Update of /cvsroot/pywin32/pywin32/com/win32com/client
In directory ddv4jf1.ch3.sourceforge.com:/tmp/cvs-serv4918/com/win32com/client
Modified Files:
dynamic.py
Log Message:
some final py3k modernizations from py3k branch
Index: dynamic.py
===================================================================
RCS file: /cvsroot/pywin32/pywin32/com/win32com/client/dynamic.py,v
retrieving revision 1.28
retrieving revision 1.29
diff -C2 -d -r1.28 -r1.29
*** dynamic.py 4 Jan 2009 22:35:14 -0000 1.28
--- dynamic.py 28 Jan 2009 11:37:02 -0000 1.29
***************
*** 73,81 ****
dispatchType = pythoncom.TypeIIDs[pythoncom.IID_IDispatch]
iunkType = pythoncom.TypeIIDs[pythoncom.IID_IUnknown]
! _GoodDispatchTypes=[str, IIDType, unicode]
_defaultDispatchItem=build.DispatchItem
def _GetGoodDispatch(IDispatch, clsctx = pythoncom.CLSCTX_SERVER):
! if type(IDispatch) in _GoodDispatchTypes:
try:
IDispatch = pythoncom.connect(IDispatch)
--- 73,82 ----
dispatchType = pythoncom.TypeIIDs[pythoncom.IID_IDispatch]
iunkType = pythoncom.TypeIIDs[pythoncom.IID_IUnknown]
!
! _GoodDispatchTypes=(str, IIDType, unicode)
_defaultDispatchItem=build.DispatchItem
def _GetGoodDispatch(IDispatch, clsctx = pythoncom.CLSCTX_SERVER):
! if isinstance(IDispatch, _GoodDispatchTypes):
try:
IDispatch = pythoncom.connect(IDispatch)
***************
*** 287,292 ****
# make a new instance of (probably this) class.
return self._wrap_dispatch_(ob, userName, ReturnCLSID)
! else:
! return ob
def _get_good_object_(self,ob,userName = None, ReturnCLSID=None):
--- 288,292 ----
# make a new instance of (probably this) class.
return self._wrap_dispatch_(ob, userName, ReturnCLSID)
! return ob
def _get_good_object_(self,ob,userName = None, ReturnCLSID=None):
***************
*** 296,300 ****
if ob is None: # Quick exit!
return None
! elif type(ob)==tuple:
return tuple(map(lambda o, s=self, oun=userName, rc=ReturnCLSID: s._get_good_single_object_(o, oun, rc), ob))
else:
--- 296,300 ----
if ob is None: # Quick exit!
return None
! elif isinstance(ob, tuple):
return tuple(map(lambda o, s=self, oun=userName, rc=ReturnCLSID: s._get_good_single_object_(o, oun, rc), ob))
else:
|