freemyipod r510 - Code Review

Jump to: navigation, search
Repository:freemyipod
Revision:r509‎ | r510 | r511 >
Date:14:54, 4 February 2011
Author:farthen
Status:new
Tags:
Comment:
emcore tools: misc.py: Fix Python 2.6 compatibility.
Modified paths:
  • /emcore/trunk/tools/misc.py (modified) (history)

Diff [purge]

Index: emcore/trunk/tools/misc.py
@@ -188,7 +188,10 @@
189189 setattr(self, field, getattr(bunch, field))
190190
191191 def _to_bunch(self):
192 - return Bunch(**{field: getattr(self, field) for field, _ in self._fields_})
 192+ bunch = Bunch()
 193+ for field, _ in self._fields_:
 194+ setattr(bunch, field, getattr(self, field))
 195+ return bunch
193196
194197 def _from_string(self, string):
195198 memmove(addressof(self), string, sizeof(self))