def install_importhook(config):
<EOL>if sys.platform.startswith("<STR_LIT>"):<EOL><INDENT>raise SystemError("<STR_LIT>")<EOL><DEDENT>config._assertstate = AssertionState(config, "<STR_LIT>")<EOL>config._assertstate.hook = hook = rewrite.AssertionRewritingHook(config)<EOL>sys.meta_path.insert(<NUM_LIT:0>, hook)<EOL>config._assertstate.trace("<STR_LIT>")<EOL>def undo():<EOL><INDENT>hook = config._assertstate.hook<EOL>if hook is not None and hook in sys.meta_path:<EOL><INDENT>sys.meta_path.remove(hook)<EOL><DEDENT><DEDENT>config.add_cleanup(undo)<EOL>return hook<EOL>
Try to install the rewrite hook, raise SystemError if it fails.