Avoid “error: None” messages from distutils (#4931).

Thanks to Amaury Forgeot d’Arc and Philip J. Eby.
Merge 3.3 (#4931)