Rev 111: When using dump_all_objects(), don't include the gc list itself. in http://bazaar.launchpad.net/~meliae-dev/meliae/trunk

John Arbash Meinel john at arbash-meinel.com
Fri Nov 20 19:23:24 GMT 2009


At http://bazaar.launchpad.net/~meliae-dev/meliae/trunk

------------------------------------------------------------
revno: 111
revision-id: john at arbash-meinel.com-20091120192314-65sr6ey0vibcu7po
parent: john at arbash-meinel.com-20091027161810-6bll36xdo2i3w41l
committer: John Arbash Meinel <john at arbash-meinel.com>
branch nick: trunk
timestamp: Fri 2009-11-20 13:23:14 -0600
message:
  When using dump_all_objects(), don't include the gc list itself.
-------------- next part --------------
=== modified file 'meliae/scanner.py'
--- a/meliae/scanner.py	2009-10-07 22:15:06 +0000
+++ b/meliae/scanner.py	2009-11-20 19:23:14 +0000
@@ -27,11 +27,14 @@
 get_referents = _scanner.get_referents
 
 
-def dump_all_referenced(outf, obj):
+def dump_all_referenced(outf, obj, is_pending=False):
     """Recursively dump everything that is referenced from obj."""
     if isinstance(outf, str):
         outf = open(outf, 'wb')
-    pending = [obj]
+    if is_pending:
+        pending = obj
+    else:
+        pending = [obj]
     last_offset = 0
     seen = _intset.IDSet()
     while last_offset >= 0:
@@ -101,7 +104,7 @@
     if isinstance(outf, basestring):
         outf = open(outf, 'wb')
     all_objs = gc.get_objects()
-    dump_all_referenced(outf, all_objs)
+    dump_all_referenced(outf, all_objs, is_pending=True)
 
 
 



More information about the bazaar-commits mailing list