Is the logic here correct? The way it works is first it tries to import gmpy 2, and then it tries to import gmpy 1 (regardless of whether or not gmpy 2 worked or not), and if gmpy 1 is installed, it will prefer that.  @casevh will be the best one to say whether we should prefer gmpy 2 or gmpy 1, but I think regardless of which one we prefer, we shouldn't bother checking for the other one if the preferred one is installed.