In pyloric stenosis, the opening between the stomach and small intestine, called the pylorus valve, thickens and gets bigger, blocking food from reaching the small intestine. Pyloric stenosis happens most often in babies under 6 months. It happens more often in males.