In a saucepan, combine sugar, flour, and salt; stir in milk and mix well.
Cook over medium heat, stirring constantly, until the mixture thickens and comes to a boil; boil for 2 minutes.
Remove from the heat.
Stir a small amount of cream mixture into egg yolks; return all to saucepan.
Cook for 2 minutes, stirring constantly; remove from the heat.
Add butter and vanilla; mix well; allow to cool slightly.
Slice the bananas and place evenly in pastry shell; pour cream mixture over bananas.
Cool; before serving, garnish with whipped cream or Cool Whip and bananas.
Refrigerate any leftovers.