Catch sort errors in ChannelUserDB.

In case the dictionnary has both integers and strings as keys, items.sort() raises a TypeError.
This commit is contained in:
Valentin Lorentz 2012-08-05 15:19:20 +02:00
parent 16aeaaa4fe
commit 124e292f1f

View File

@ -313,7 +313,12 @@ class ChannelUserDB(ChannelUserDictionary):
self.__class__.__name__)
fd.rollback()
return
items.sort()
try:
items.sort()
except TypeError:
# FIXME: Implement an algorithm that can order dictionnaries
# with both strings and integers as keys.
pass
for ((channel, id), v) in items:
L = self.serialize(v)
L.insert(0, id)