diff --git a/src/trio/_core/_run.py b/src/trio/_core/_run.py index 0d8aa45ad..1dba56b02 100644 --- a/src/trio/_core/_run.py +++ b/src/trio/_core/_run.py @@ -1726,7 +1726,7 @@ def close(self) -> None: self.asyncgens.close() if "after_run" in self.instruments: self.instruments.call("after_run") - self.system_nursery: Nursery | None = None + self.system_nursery = None # This is where KI protection gets disabled, so we do it last self.ki_manager.close()