In a small saucepan, bring the milk to a boil over medium heat. Meanwhile, whisk egg yolks and sugar together in a small bowl. Add flour, and mix until smooth and free of lumps.
Thin egg-yolk mixture with approximately 1/4 cup of warm milk. When remaining milk begins to boil, add it to egg-yolk mixture, and stir well. Return to saucepan, and place over high heat. Cook, whisking constantly, until pastry cream thickens and boils, about 1 minute. (Turning the pan as you whisk helps to easily reach all areas of pan.)
Reduce heat to medium, and cook, whisking constantly, until cream becomes shiny and easier to stir, about 2 minutes more. Pour into a bowl, and stir in vanilla. Place plastic wrap directly on surface of pastry cream to prevent a skin from forming, and allow to cool.