Skip to content

Commit

Permalink
Review responses
Browse files Browse the repository at this point in the history
  • Loading branch information
oremanj committed Aug 5, 2020
1 parent 33d168e commit 0441952
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 8 deletions.
8 changes: 1 addition & 7 deletions trio/_core/_run.py
Original file line number Diff line number Diff line change
Expand Up @@ -1301,9 +1301,6 @@ class Runner:
is_guest = attr.ib(default=False)
guest_tick_scheduled = attr.ib(default=False)

def __attrs_post_init__(self):
self.asyncgens.install_hooks(self)

def force_guest_tick_asap(self):
if self.guest_tick_scheduled:
return
Expand Down Expand Up @@ -1525,10 +1522,6 @@ def task_exited(self, task, outcome):
if "task_exited" in self.instruments:
self.instruments.call("task_exited", task)

################
# Async generator finalization support
################

################
# System tasks and init
################
Expand Down Expand Up @@ -1833,6 +1826,7 @@ def setup_runner(clock, instruments, restrict_keyboard_interrupt_to_checkpoints)
system_context=system_context,
ki_manager=ki_manager,
)
runner.asyncgens.install_hooks(runner)

# This is where KI protection gets enabled, so we want to do it early - in
# particular before we start modifying global state like GLOBAL_RUN_CONTEXT
Expand Down
1 change: 0 additions & 1 deletion trio/_core/tests/test_instrumentation.py
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,6 @@ async def main():
+ [("before", task), ("schedule", task), ("after", task)] * 5
+ [("before", task), ("after", task), ("after_run",)]
)
assert len(r1.record) > len(r2.record) > len(r3.record)
assert r1.record == r2.record + r3.record
assert list(r1.filter_tasks([task])) == expected

Expand Down

0 comments on commit 0441952

Please sign in to comment.