Commits

Armin Rigo  committed 1518e9e

Remove dictionary-order dependencies.

  • Participants
  • Parent commits 6cffa09

Comments (0)

Files changed (2)

File cffi/vengine_cpy.py

         self._load(module, 'loaded', library=library)
         return library
 
+    def _get_declarations(self):
+        return sorted(self.ffi._parser._declarations.items())
+
     def _generate(self, step_name):
-        for name, tp in self.ffi._parser._declarations.items():
+        for name, tp in self._get_declarations():
             kind, realname = name.split(' ', 1)
             try:
                 method = getattr(self, '_generate_cpy_%s_%s' % (kind,
             method(tp, realname)
 
     def _load(self, module, step_name, **kwds):
-        for name, tp in self.ffi._parser._declarations.items():
+        for name, tp in self._get_declarations():
             kind, realname = name.split(' ', 1)
             method = getattr(self, '_%s_cpy_%s' % (step_name, kind))
             method(tp, realname, module, **kwds)

File cffi/vengine_gen.py

         self._load(module, 'loaded', library=library)
         return library
 
+    def _get_declarations(self):
+        return sorted(self.ffi._parser._declarations.items())
+
     def _generate(self, step_name):
-        for name, tp in self.ffi._parser._declarations.items():
+        for name, tp in self._get_declarations():
             kind, realname = name.split(' ', 1)
             try:
                 method = getattr(self, '_generate_gen_%s_%s' % (kind,
             method(tp, realname)
 
     def _load(self, module, step_name, **kwds):
-        for name, tp in self.ffi._parser._declarations.items():
+        for name, tp in self._get_declarations():
             kind, realname = name.split(' ', 1)
             method = getattr(self, '_%s_gen_%s' % (step_name, kind))
             method(tp, realname, module, **kwds)