def mkint( string ) :
    """Try converting a string to base-10 integer. If that fails, try base-16.
    If that fails, we'll allow the ValueError to propogate."""

    value = None
    try :
        value = int(string,10)
    except ValueError:
        value = None
        pass

    if value is None :
        # ok, maybe it's hex
        value = int(string,16)

    return value