Pyloromyotomy. In surgery to treat pyloric stenosis, called a pyloromyotomy, the surgeon makes an incision in the wall of the pylorus. The lining of the pylorus bulges through the incision, opening a channel from the stomach to the small intestine. Surgery is needed to treat pyloric stenosis.