Fix enum compatibility with older Pythons.