Get latest PMI.
Fix to work with Python 3.
Use new style exception syntax.