Skip to content

Commit

Permalink
Bugfix for MultiWidget.removeWidgets on Python 3
Browse files Browse the repository at this point in the history
You can't iterate over zip() twice in Python 3.  This used to clear
self.widgets completely on Python 3.  Luckily tests caught it.

Fixes #13.
  • Loading branch information
mgedmin committed Oct 11, 2013
1 parent 27a47f4 commit 7e31de1
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/z3c/form/widget.py
Original file line number Diff line number Diff line change
Expand Up @@ -346,7 +346,7 @@ def removeWidgets(self, names):
:param names: list of widget.name to remove from the value
:return: None
"""
zipped = zip(self.key_widgets,self.widgets)
zipped = list(zip(self.key_widgets,self.widgets))
self.key_widgets = [k for k,v in zipped if v.name not in names]
self.widgets = [v for k,v in zipped if v.name not in names]
if self.is_dict:
Expand Down

0 comments on commit 7e31de1

Please sign in to comment.