def unsplit(splitted_iter):
    """
	catenate a split string. This is needed to handle the special
	cases created by pg.string.split(). (Run-away quotations, primarily)
	"""
    s = ''
    quoted = False
    i = iter(splitted_iter)
    endq = ''
    for x in i:
        s += endq + x
        try:
            q, qtext = next(i)
            s += q + qtext
            if q == "E'":
                endq = "'"
            else:
                endq = q
        except StopIteration:
            break
    return s
