def __init__(self, code, **exception_kwargs):
        m = re.match(r"^(\w+)(?:\s+(.*?))?:\s*(#|$)", code.strip(), re.S)
        if not m:
            raise exceptions.CompileException(
                "Fragment '%s' is not a partial control statement" % code,
                **exception_kwargs
            )
        if m.group(3):
            code = code[: m.start(3)]
        (keyword, expr) = m.group(1, 2)
        if keyword in ["for", "if", "while"]:
            code = code + "pass"
        elif keyword == "try":
            code = code + "pass\nexcept:pass"
        elif keyword == "elif" or keyword == "else":
            code = "if False:pass\n" + code + "pass"
        elif keyword == "except":
            code = "try:pass\n" + code + "pass"
        elif keyword == "with":
            code = code + "pass"
        else:
            raise exceptions.CompileException(
                "Unsupported control keyword: '%s'" % keyword,
                **exception_kwargs
            )
        super(PythonFragment, self).__init__(code, **exception_kwargs)