def read_or_raise(fin, size):
    """ Instead of returning a result smaller than `size` like `io.read()`,
		it raises and EOFError.
	"""
    data = fin.read(size)
    if len(data) != size:
        raise EOFError
    return data
