Patch provided by Martin Wilke via PR 34574. And also work with python24, so add 24 to PYTHON_VERSIONS_ACCEPTED.