Improved #20889 -- Replaced float("inf) with sys.maxint