Author: Armin Rigo <[email protected]>
Branch:
Changeset: r1071:1518e9e97003
Date: 2012-11-28 10:04 -0800
http://bitbucket.org/cffi/cffi/changeset/1518e9e97003/
Log: Remove dictionary-order dependencies.
diff --git a/cffi/vengine_cpy.py b/cffi/vengine_cpy.py
--- a/cffi/vengine_cpy.py
+++ b/cffi/vengine_cpy.py
@@ -151,8 +151,11 @@
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,
@@ -163,7 +166,7 @@
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)
diff --git a/cffi/vengine_gen.py b/cffi/vengine_gen.py
--- a/cffi/vengine_gen.py
+++ b/cffi/vengine_gen.py
@@ -66,8 +66,11 @@
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,
@@ -78,7 +81,7 @@
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)
_______________________________________________
pypy-commit mailing list
[email protected]
http://mail.python.org/mailman/listinfo/pypy-commit