I am writing some Python code that runs under multiple platforms. Unfortunately under Win32, I have to support some COM functionalities.
However these lines will fail under an Linux environment:
from pythoncom import PumpWaitingMessages
from pythoncom import Empty
from pythoncom import Missing
from pythoncom import com_error
import win32api
And all the other functions which are using the Win32 COM API will fail as well. What is the standard method to make sure that some code is not loaded/imported depending on the platform and give an error message/exception in the case they are called by the client of the interface ?