Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 5074303

Browse files
authored
Merge pull request #12143 from meeseeksmachine/auto-backport-of-pr-12142-on-v3.0.x
Backport PR #12142 on branch v3.0.x (Unbreak formlayout for image edits.)
2 parents b4e44c2 + 2fdf5d1 commit 5074303

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

lib/matplotlib/backends/qt_editor/formlayout.py

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -243,8 +243,14 @@ def setup(self):
243243
elif isinstance(value, str):
244244
field = QtWidgets.QLineEdit(value, self)
245245
elif isinstance(value, (list, tuple)):
246+
if isinstance(value, tuple):
247+
value = list(value)
248+
# Note: get() below checks the type of value[0] in self.data so
249+
# it is essential that value gets modified in-place.
250+
# This means that the code is actually broken in the case where
251+
# value is a tuple, but fortunately we always pass a list...
252+
selindex = value.pop(0)
246253
field = QtWidgets.QComboBox(self)
247-
selindex, *value = value
248254
if isinstance(value[0], (list, tuple)):
249255
keys = [key for key, _val in value]
250256
value = [val for _key, val in value]

0 commit comments

Comments
 (0)