Remove deprecated function call
correct exception message
Merge pull request #2551 from dessant/patch-10

Remove deprecated function call