Simpler, more robust test for ImportError text