Use an OrderedDict for Module.info (preserving modinfo ordering).
authorW. Trevor King <wking@tremily.us>
Fri, 19 Oct 2012 11:18:58 +0000 (07:18 -0400)
committerW. Trevor King <wking@tremily.us>
Fri, 19 Oct 2012 11:18:58 +0000 (07:18 -0400)
Signed-off-by: W. Trevor King <wking@tremily.us>
kmod/module.pyx

index b25f24f24d194f8a8be6a56c8e18c4b107c1a8f7..31336b0a1e90cbe7cc0831c2e010268ee8b3a0dc 100644 (file)
@@ -9,6 +9,8 @@
 # along with this program; if not, write to the Free Software Foundation,
 # Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
 
+import collections as _collections
+
 cimport libc.errno as _errno
 
 cimport _libkmod_h
@@ -75,7 +77,7 @@ cdef class Module (object):
         err = _libkmod_h.kmod_module_get_info(self.module, &ml.list)
         if err < 0:
             raise _KmodError('Could not get versions')
-        info = {}
+        info = _collections.OrderedDict()
         try:
             for item in ml:
                 mli = <_list.ModListItem> item