def my_split(s):
    """Explodes a string around commas except when in a {}-environment.
    See <http://stackoverflow.com/a/26809037/353337>.
    """
    parts = []
    bracket_level = 0
    current = []
    # trick to remove special-case of trailing chars
    for c in s + ",":
        if c == "," and bracket_level == 0:
            parts.append("".join(current))
            current = []
        else:
            if c == "{":
                bracket_level += 1
            elif c == "}":
                bracket_level -= 1
            current.append(c)
    return parts