def get_ext(fname):
    """Returns the extension of a filename, or None if there is no extension."""
    for ii in range(len(fname) - 1, -1, -1):
        if fname[ii] == ".":
            return fname[ii + 1 :]