()
| 134 | config.stash[assertstate_key].trace(class="st">"installed rewrite import hook") |
| 135 | |
| 136 | def undo() -> None: |
| 137 | hook = config.stash[assertstate_key].hook |
| 138 | if hook is not None and hook in sys.meta_path: |
| 139 | sys.meta_path.remove(hook) |
| 140 | |
| 141 | config.add_cleanup(undo) |
| 142 | return hook |