Please update the block to:

    try:
        maxint = sys.maxint
    except AttributeError:
        maxint = pow(2, 32)
        long  = int