Revised for latest Python.