Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(5)

Unified Diff: third_party/twisted_8_1/twisted/python/finalize.py

Issue 12261012: Remove third_party/twisted_8_1 (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/tools/build
Patch Set: Created 7 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: third_party/twisted_8_1/twisted/python/finalize.py
diff --git a/third_party/twisted_8_1/twisted/python/finalize.py b/third_party/twisted_8_1/twisted/python/finalize.py
deleted file mode 100644
index 8b99bf6aa8f17ef11b146ac6175083e58c2d3cd2..0000000000000000000000000000000000000000
--- a/third_party/twisted_8_1/twisted/python/finalize.py
+++ /dev/null
@@ -1,46 +0,0 @@
-
-"""
-A module for externalized finalizers.
-"""
-
-import weakref
-
-garbageKey = 0
-
-def callbackFactory(num, fins):
- def _cb(w):
- del refs[num]
- for fx in fins:
- fx()
- return _cb
-
-refs = {}
-
-def register(inst):
- global garbageKey
- garbageKey += 1
- r = weakref.ref(inst, callbackFactory(garbageKey, inst.__finalizers__()))
- refs[garbageKey] = r
-
-if __name__ == '__main__':
- def fin():
- print 'I am _so_ dead.'
-
- class Finalizeable:
- """
- An un-sucky __del__
- """
-
- def __finalizers__(self):
- """
- I'm going away.
- """
- return [fin]
-
- f = Finalizeable()
- f.f2 = f
- register(f)
- del f
- import gc
- gc.collect()
- print 'deled'
« no previous file with comments | « third_party/twisted_8_1/twisted/python/filepath.py ('k') | third_party/twisted_8_1/twisted/python/formmethod.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698