Update of /cvsroot/pywin32/pywin32/com/win32com/servers
In directory ddv4jf1.ch3.sourceforge.com:/tmp/cvs-serv27962/com/win32com/servers
Modified Files:
Tag: py3k
dictionary.py interp.py
Log Message:
merge recent UnicodeType, string module and NeedUnicodeConversions changes from trunk
Index: interp.py
===================================================================
RCS file: /cvsroot/pywin32/pywin32/com/win32com/servers/interp.py,v
retrieving revision 1.2.4.2
retrieving revision 1.2.4.3
diff -C2 -d -r1.2.4.2 -r1.2.4.3
*** interp.py 27 Nov 2008 04:58:41 -0000 1.2.4.2
--- interp.py 4 Dec 2008 05:08:41 -0000 1.2.4.3
***************
*** 13,17 ****
from win32com.server.exception import Exception
- from pywintypes import UnicodeType
import winerror
--- 13,16 ----
***************
*** 34,38 ****
"""Evaluate an expression.
"""
! if type(exp) not in [type(''),UnicodeType]:
raise Exception(desc="Must be a string",scode=winerror.DISP_E_TYPEMISMATCH)
--- 33,37 ----
"""Evaluate an expression.
"""
! if type(exp) not in [str, str]:
raise Exception(desc="Must be a string",scode=winerror.DISP_E_TYPEMISMATCH)
***************
*** 41,45 ****
"""Execute a statement.
"""
! if type(exp) not in [type(''), UnicodeType]:
raise Exception(desc="Must be a string",scode=winerror.DISP_E_TYPEMISMATCH)
exec(str(exp), self.dict)
--- 40,44 ----
"""Execute a statement.
"""
! if type(exp) not in [str, str]:
raise Exception(desc="Must be a string",scode=winerror.DISP_E_TYPEMISMATCH)
exec(str(exp), self.dict)
Index: dictionary.py
===================================================================
RCS file: /cvsroot/pywin32/pywin32/com/win32com/servers/dictionary.py,v
retrieving revision 1.3.4.1
retrieving revision 1.3.4.2
diff -C2 -d -r1.3.4.1 -r1.3.4.2
*** dictionary.py 27 Nov 2008 04:58:41 -0000 1.3.4.1
--- dictionary.py 4 Dec 2008 05:08:41 -0000 1.3.4.2
***************
*** 32,36 ****
"""
- import string
import pythoncom
from win32com.server import util, policy
--- 32,35 ----
***************
*** 43,50 ****
from winerror import S_OK
- UnicodeType = pywintypes.UnicodeType
- StringType = bytes
-
-
class DictionaryPolicy(policy.BasicWrapPolicy):
### BasicWrapPolicy looks for this
--- 42,45 ----
***************
*** 79,87 ****
key = args[0]
! if type(key) == UnicodeType:
! pass
! elif type(key) == StringType:
! key = pywintypes.Unicode(key)
! else:
### the nArgErr thing should be 0-based, not reversed... sigh
raise COMException(desc="Key must be a string", scode=winerror.DISP_E_TYPEMISMATCH)
--- 74,78 ----
key = args[0]
! if type(exp) not in [str, str]:
### the nArgErr thing should be 0-based, not reversed... sigh
raise COMException(desc="Key must be a string", scode=winerror.DISP_E_TYPEMISMATCH)
***************
*** 124,129 ****
### this is a copy of MappedWrapPolicy._getidsofnames_ ...
! # Note: these names will always be StringType
! name = string.lower(names[0])
try:
return (self._name_to_dispid_[name],)
--- 115,119 ----
### this is a copy of MappedWrapPolicy._getidsofnames_ ...
! name = names[0].lower()
try:
return (self._name_to_dispid_[name],)
|