[pywin32-checkins] pywin32/com/win32com/client selecttlb.py, 1.8, 1.9
OLD project page for the Python extensions for Windows
Brought to you by:
mhammond
From: Mark H. <mha...@us...> - 2007-08-27 15:40:28
|
Update of /cvsroot/pywin32/pywin32/com/win32com/client In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv25480 Modified Files: selecttlb.py Log Message: Fix [ 1773724 ] Selecttlb doesn't handle hexadecimal version numbers Index: selecttlb.py =================================================================== RCS file: /cvsroot/pywin32/pywin32/com/win32com/client/selecttlb.py,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** selecttlb.py 25 Apr 2004 04:24:27 -0000 1.8 --- selecttlb.py 25 Aug 2007 05:09:21 -0000 1.9 *************** *** 8,13 **** self.clsid = str(clsid) self.lcid = int(lcid) ! self.major = int(major) ! self.minor = int(minor) self.dll = None self.desc = None --- 8,17 ---- self.clsid = str(clsid) self.lcid = int(lcid) ! # We avoid assuming 'major' or 'minor' are integers - when ! # read from the registry there is some confusion about if ! # they are base 10 or base 16 (they *should* be base 16, but ! # how they are written is beyond our control.) ! self.major = major ! self.minor = minor self.dll = None self.desc = None *************** *** 84,98 **** if len(major_minor) < 2: major_minor.append('0') ! try: ! # For some reason, this code used to assume the values were hex. ! # This seems to not be true - particularly for CDO 1.21 ! # *sigh* - it appears there are no rules here at all, so when we need ! # to know the info, we must load the tlb by filename and request it. ! # The Resolve() method on the TypelibSpec does this. ! major = int(major_minor[0]) ! minor = int(major_minor[1]) ! except ValueError: # crap in the registry! ! continue ! key3 = win32api.RegOpenKey(key2, str(version)) try: --- 88,102 ---- if len(major_minor) < 2: major_minor.append('0') ! # For some reason, this code used to assume the values were hex. ! # This seems to not be true - particularly for CDO 1.21 ! # *sigh* - it appears there are no rules here at all, so when we need ! # to know the info, we must load the tlb by filename and request it. ! # The Resolve() method on the TypelibSpec does this. ! # For this reason, keep the version numbers as strings - that ! # way we can't be wrong! Let code that really needs an int to work ! # out what to do. FWIW, http://support.microsoft.com/kb/816970 is ! # pretty clear that they *should* be hex. ! major = major_minor[0] ! minor = major_minor[1] key3 = win32api.RegOpenKey(key2, str(version)) try: |