[pypy-commit] pypy default: fix so these test don't rely on dict ordering

alex_gaynor noreply at buildbot.pypy.org
Sat Oct 29 19:44:58 CEST 2011


Author: Alex Gaynor <alex.gaynor at gmail.com>
Branch: 
Changeset: r48598:a257711072e5
Date: 2011-10-29 19:31 +0200
http://bitbucket.org/pypy/pypy/changeset/a257711072e5/

Log:	fix so these test don't rely on dict ordering

diff --git a/pypy/jit/metainterp/optimizeopt/virtualize.py b/pypy/jit/metainterp/optimizeopt/virtualize.py
--- a/pypy/jit/metainterp/optimizeopt/virtualize.py
+++ b/pypy/jit/metainterp/optimizeopt/virtualize.py
@@ -294,7 +294,12 @@
         optforce.emit_operation(self.source_op)
         self.box = box = self.source_op.result
         for index in range(len(self._items)):
-            for descr, value in self._items[index].iteritems():
+            iteritems = self._items[index].iteritems()
+            # random order is fine, except for tests
+            if not we_are_translated():
+                iteritems = list(iteritems)
+                iteritems.sort(key = lambda (x, y): x.sort_key())
+            for descr, value in iteritems:
                 subbox = value.force_box(optforce)
                 op = ResOperation(rop.SETINTERIORFIELD_GC,
                     [box, ConstInt(index), subbox], None, descr=descr


More information about the pypy-commit mailing list