BUG: Fix wrong variable in test_build.py exception.

The variable used was not defined, causing an error when the exception
was raised.

Closes #3146.
Merge pull request #4298 from charris/fix-gh-3146

BUG: Fix wrong variable in test_build.py exception.