Update of /cvsroot/pywin32/pywin32/com/win32com/client
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv20634
Modified Files:
Tag: py3k
build.py genpy.py
Log Message:
Fix some problems with makepy generation
Index: genpy.py
===================================================================
RCS file: /cvsroot/pywin32/pywin32/com/win32com/client/genpy.py,v
retrieving revision 1.55.2.1
retrieving revision 1.55.2.2
diff -C2 -d -r1.55.2.1 -r1.55.2.2
*** genpy.py 29 Aug 2008 08:58:53 -0000 1.55.2.1
--- genpy.py 31 Aug 2008 09:33:17 -0000 1.55.2.2
***************
*** 205,215 ****
if vdesc[4] == pythoncom.VAR_CONST:
val = vdesc[1]
! if type(val) in (type(0), type(0)):
! if val==0x80000000: # special case
! use = "0x80000000L" # 'L' for future warning
! elif val > 0x80000000 or val < 0: # avoid a FutureWarning
! use = int(val)
! else:
! use = hex(val)
else:
use = repr(str(val))
--- 205,210 ----
if vdesc[4] == pythoncom.VAR_CONST:
val = vdesc[1]
! if isinstance(val, int):
! use=val
else:
use = repr(str(val))
***************
*** 514,518 ****
print('\tdef __getitem__(self, index):', file=stream)
print('\t\t"Allow this class to be accessed as a collection"', file=stream)
! print("\t\tif not self.__dict__.has_key('_enum_'):", file=stream)
print("\t\t\tself.__dict__['_enum_'] = self._NewEnum()", file=stream)
print("\t\treturn self._enum_.__getitem__(index)", file=stream)
--- 509,513 ----
print('\tdef __getitem__(self, index):', file=stream)
print('\t\t"Allow this class to be accessed as a collection"', file=stream)
! print("\t\tif '_enum_' not in self.__dict__:", file=stream)
print("\t\t\tself.__dict__['_enum_'] = self._NewEnum()", file=stream)
print("\t\treturn self._enum_.__getitem__(index)", file=stream)
Index: build.py
===================================================================
RCS file: /cvsroot/pywin32/pywin32/com/win32com/client/build.py,v
retrieving revision 1.31.2.1
retrieving revision 1.31.2.2
diff -C2 -d -r1.31.2.1 -r1.31.2.2
*** build.py 29 Aug 2008 08:58:52 -0000 1.31.2.1
--- build.py 31 Aug 2008 09:33:17 -0000 1.31.2.2
***************
*** 19,23 ****
import sys
import string
! import types
from keyword import iskeyword
from win32com.client import NeedUnicodeConversions
--- 19,24 ----
import sys
import string
! import builtins
!
from keyword import iskeyword
from win32com.client import NeedUnicodeConversions
***************
*** 455,460 ****
resultTypeInfo = itypeinfo.GetRefTypeInfo(subrepr)
except pythoncom.com_error as details:
! if details[0] in [winerror.TYPE_E_CANTLOADLIBRARY,
! winerror.TYPE_E_LIBNOTREGISTERED]:
# an unregistered interface
return pythoncom.VT_UNKNOWN, None, None
--- 456,460 ----
resultTypeInfo = itypeinfo.GetRefTypeInfo(subrepr)
except pythoncom.com_error as details:
! if details.args[0] in [winerror.TYPE_E_CANTLOADLIBRARY, winerror.TYPE_E_LIBNOTREGISTERED]:
# an unregistered interface
return pythoncom.VT_UNKNOWN, None, None
***************
*** 533,537 ****
# that if it was a global it would get picked up below
className = 'NONE'
! elif is_global and className in __builtins__:
# builtins may be mixed case. If capitalizing it doesn't change it,
# force to all uppercase (eg, "None", "True" become "NONE", "TRUE"
--- 533,537 ----
# that if it was a global it would get picked up below
className = 'NONE'
! elif is_global and hasattr(builtins, className):
# builtins may be mixed case. If capitalizing it doesn't change it,
# force to all uppercase (eg, "None", "True" become "NONE", "TRUE"
|