py3 fix and fetching constants from the right class