Fixes a Python 3.x regression introduced in a19e9d80
Merge pull request #1135 from ambv/model_validation_fix

Fixes a Python 3.x regression introduced in a19e9d80