frozen win32com problem

Robin Becker robin at jessikat.fsnet.co.uk
Thu Jan 10 11:34:20 CET 2002


In article <3C3D1CBB.5040000 at skippinet.com.au>, Mark Hammond <mhammond at skippinet.com.au> writes
>Robin Becker wrote:
>
>Actually, I could see how this happens.  I just checked in the following 
>patch.
>
>RCS file: /home/cvsroot/PyWin32/com/win32com/server/register.py,v
>retrieving revision 1.4
>retrieving revision 1.5
>diff -r1.4 -r1.5
>12a13
>> import win32com
>420c421,424
><   RegisterPyComCategory()
>---
>>   try:
>>     RegisterPyComCategory()
>>   except win32com.error: # Error with the COM category manager - oh well.
>>     pass
>
>
>Mark.
>
OK I tries this and got a complaint about win32com.error

I used instead

try:  
  win32api.RegQueryValue(win32con.HKEY_CLASSES_ROOT,
                         'Component Categories\\%s' % CATID_PythonCOMServer)
except win32api.error:
  import pywintypes
  try:
    RegisterPyComCategory()
  except pywintypes.com_error:  # Error with the COM category manager - oh well.
    pass

and then things went well. I did
interp.py --register
interp.py --test 
and things worked.

so my patch (presumably against 1.4) was,
*** register.py.orig    Fri Aug 04 18:29:16 2000
--- register.py Thu Jan 10 10:29:32 2002
***************
*** 417,421 ****
    win32api.RegQueryValue(win32con.HKEY_CLASSES_ROOT,
                           'Component Categories\\%s' % CATID_PythonCOMServer)
  except win32api.error:
!   RegisterPyComCategory()
!
--- 417,424 ----
    win32api.RegQueryValue(win32con.HKEY_CLASSES_ROOT,
                           'Component Categories\\%s' % CATID_PythonCOMServer)
  except win32api.error:
!   import pywintypes
!   try:
!     RegisterPyComCategory()
!   except pywintypes.com_error:  # Error with the COM category manager - oh well.
!         pass
-- 
Robin Becker



More information about the Python-list mailing list