I don't buy bananas in the summer, but I still manage to get fruit flies with my compost pot. I saw a remedy for the fruit flies once and it really works. Get a bottle of cheap wine. Leave only a quarter of the wine in the bottle and add a little sugar if it's on the dry side. The fruit flies will fly into the bottle for the wine and they can't get back out because of the shape of the wine bottle.