I have a module that uses lxml. Since this cannot be imported on GAE, I'd like to use a suitable substitute by default. Something along the lines of:
if not ON_GAE:
import lxml
else:
import beautifulsoup
How can I determine that I'm on GAE? Is there a OS variable of some sorts?
Update: There are certain modules that will not run on GAE (like sockets
). Rather than having multiple blocks of try
... except ImportError
, I'd like to know from the start which code blocks needs an alternative implementation.