Fix for Python 2.6, which is missing PyErr_NewExceptionWithDoc