In a small bowl, whisk together egg yolks and vanilla. Set aside.
Whisk together in a medium-sized saucepan, sugar, cocoa, cornstarch and salt. Slowly whisk in half the milk. Add the rest of the milk and whisk until sugar dissolves, about a minute. Bring mixture to a boil over low heat, stirring constantly and cook about a minute. Remove from heat.
Add about a teaspoon of hot mixture to whisked yolks to temper and avoid eggs precooking. Add egg mixture to chocolate mixture. Cook about 1 to 2 minutes, stirring constantly until mixture thickens. Remove from heat and whisk in butter.
Pour pudding mixture into baked pie shell.