Rev 113: Fix bug #493531 from James Henstridge. in http://bazaar.launchpad.net/~meliae-dev/meliae/trunk
John Arbash Meinel
john at arbash-meinel.com
Mon Dec 7 19:50:01 GMT 2009
At http://bazaar.launchpad.net/~meliae-dev/meliae/trunk
------------------------------------------------------------
revno: 113 [merge]
revision-id: john at arbash-meinel.com-20091207194950-sjzuslftler7p37n
parent: john at arbash-meinel.com-20091202150124-5641q7db43l7tgc7
parent: james at jamesh.id.au-20091207112103-7lwfxaorxh30x5rp
committer: John Arbash Meinel <john at arbash-meinel.com>
branch nick: trunk
timestamp: Mon 2009-12-07 13:49:50 -0600
message:
Fix bug #493531 from James Henstridge.
modified:
meliae/scanner.py scanner.py-20090402040945-idv8d14z8re05gvg-1
meliae/tests/test_scanner.py test_scanner.py-20090402040945-idv8d14z8re05gvg-2
-------------- next part --------------
=== modified file 'meliae/scanner.py'
--- a/meliae/scanner.py 2009-11-20 19:23:14 +0000
+++ b/meliae/scanner.py 2009-12-07 11:21:03 +0000
@@ -35,7 +35,7 @@
pending = obj
else:
pending = [obj]
- last_offset = 0
+ last_offset = len(pending) - 1
seen = _intset.IDSet()
while last_offset >= 0:
next = pending[last_offset]
=== modified file 'meliae/tests/test_scanner.py'
--- a/meliae/tests/test_scanner.py 2009-09-18 17:00:34 +0000
+++ b/meliae/tests/test_scanner.py 2009-12-07 11:21:03 +0000
@@ -25,13 +25,13 @@
class TestDumpAllReferenced(tests.TestCase):
- def assertDumpAllReferenced(self, ref_objs, obj):
+ def assertDumpAllReferenced(self, ref_objs, obj, is_pending=False):
t = tempfile.TemporaryFile(prefix='meliae-')
# On some platforms TemporaryFile returns a wrapper object with 'file'
# being the real object, on others, the returned object *is* the real
# file object
t_file = getattr(t, 'file', t)
- scanner.dump_all_referenced(t_file, obj)
+ scanner.dump_all_referenced(t_file, obj, is_pending=is_pending)
t.flush()
t.seek(0)
# We don't care if the same entries are printed multiple times, just
@@ -65,6 +65,13 @@
l = [k, v, t]
self.assertDumpAllReferenced([k, v, l, t], l)
+ def test_dump_list_of_tuple_is_pending(self):
+ k = 10245
+ v = 'a value string'
+ t = (v,)
+ l = [t, k]
+ self.assertDumpAllReferenced([k, t, v], l, is_pending=True)
+
def test_dump_recursive(self):
a = 1
b = 'str'
More information about the bazaar-commits
mailing list