]> granicus.if.org Git - python/commit
Prevent classes like:
authorJeffrey Yasskin <jyasskin@gmail.com>
Sat, 23 Feb 2008 19:40:54 +0000 (19:40 +0000)
committerJeffrey Yasskin <jyasskin@gmail.com>
Sat, 23 Feb 2008 19:40:54 +0000 (19:40 +0000)
commit3414ea9ed9fce2b9ce74e8b6c7c3b4278b526685
tree8a4e5b603996a8a72c4f6436f1954c23b17e0fad
parent1beea27299b836fd9194b769f2f79913ed20219e
Prevent classes like:
    class RunSelfFunction(object):
        def __init__(self):
            self.thread = threading.Thread(target=self._run)
            self.thread.start()
        def _run(self):
            pass
from creating a permanent cycle between the object and the thread by having the
Thread delete its references to the object when it completes.

As an example of the effect of this bug, paramiko.Transport inherits from
Thread to avoid it.
Lib/test/test_threading.py
Lib/threading.py