> Hi guys,
> 
> This is a silly question but how do I capture a com_error from another
> module?  Below is the code I'm trying but it's not working.  I get
> this error:
> Traceback (most recent call last):
> ...
>     except com_error:
> NameError: name 'com_error' is not defined

com_error is in the pythoncom module.  So you want:

import pythoncom
...
try:
  ...
except pythoncom.com_error:
  ...

Mark

_______________________________________________
Python-win32 mailing list
Python-win32@python.org
http://mail.python.org/mailman/listinfo/python-win32

Reply via email to