//Speedup: as this method is called a lot, we just check if the nature is available internally without
//any locks, and just lock if it's not (which is needed to avoid a racing condition creating more
//than 1 nature).
try {
if (project instanceof Project) {
Project p = (Project) project;
ProjectInfo info = (ProjectInfo) p.getResourceInfo(false, false);
IProjectNature nature = info.getNature(PYTHON_NATURE_ID);
if (nature instanceof PythonNature) {
return (PythonNature) nature;
}
}