I am trying to update a Python script that makes calls to a COM object. Instead of catching plain vanilla Exception objects, I want to catch com_error objects. I am using:
from pythoncom import com_error
My script works, but PyCharm underlines com_error in red, calling it an unresolved reference, and if I try to use any members of the com_error class in my code, they are also flagged unresolved.
Is there some way to get PyCharm to find the pythoncom or pywintypes modules?
I'm using the 32-bit version of Python 3.7. I found the file pythoncom.py in C:\Python37-32\lib\site-packages.
com_error
. – MegaIng Oct 4 '19 at 20:04pythoncom
module or did it not find thecom_error
? – MegaIng Oct 4 '19 at 20:21pythoncom
file (Strg+b on the Name), and then search forcom_error
(or 'class com_error'), do you find any global definitions? – MegaIng Oct 4 '19 at 20:26