From 9de83f008cc3f46dd97331bc470bde639b569773 Mon Sep 17 00:00:00 2001 From: "W. Trevor King" Date: Fri, 19 Oct 2012 07:18:58 -0400 Subject: [PATCH] Use an OrderedDict for Module.info (preserving modinfo ordering). Signed-off-by: W. Trevor King --- kmod/module.pyx | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/kmod/module.pyx b/kmod/module.pyx index b25f24f..31336b0 100644 --- a/kmod/module.pyx +++ b/kmod/module.pyx @@ -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 -- 2.26.2