Skip to content

Commit ebea928

Browse files
committed
Add a comment explaining why _handle_job() is a separate method
1 parent 3d2a604 commit ebea928

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

trio/_core/_thread_cache.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,8 @@ def __init__(self, thread_cache):
5757
thread.start()
5858

5959
def _handle_job(self):
60+
# Handle job in a separate method to ensure user-created
61+
# objects are cleaned up in a consistent manner.
6062
fn, deliver = self._job
6163
self._job = None
6264
result = outcome.capture(fn)

0 commit comments

Comments
 (0)