Changes to support gmpy 1.13 or later, or gmpy2 2.0.0b4 or later.