From c9f160e8fbc149b2e44283c56fff423d59bab48b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Laura=20Kl=C3=BCnder?= Date: Sat, 25 Nov 2017 14:57:34 +0100 Subject: [PATCH] don't store update list as tuple, we can't modify it then --- src/c3nav/mapdata/utils/cache/maphistory.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/c3nav/mapdata/utils/cache/maphistory.py b/src/c3nav/mapdata/utils/cache/maphistory.py index b003b164..16e20097 100644 --- a/src/c3nav/mapdata/utils/cache/maphistory.py +++ b/src/c3nav/mapdata/utils/cache/maphistory.py @@ -53,8 +53,9 @@ class MapHistory(LevelGeometryIndexed): def simplify(self): # remove updates that have no longer any array cells new_updates = ((i, update, (self.data == i)) for i, update in enumerate(self.updates)) - self.updates, new_affected = zip(*((update, affected) for i, update, affected in new_updates - if i == 0 or affected.any())) + new_updates, new_affected = zip(*((update, affected) for i, update, affected in new_updates + if i == 0 or affected.any())) + self.updates = list(new_updates) for i, affected in enumerate(new_affected): self.data[affected] = i