Closed philipstarkey closed 5 years ago
Original comment by Chris Billington (Bitbucket: cbillington, GitHub: chrisjbillington).
Ah yes. .items()
doesn't make a copy of a dict in Python 3.
for device_name, labscript_device_class_name in list(self.attached_devices.items()):
should be sufficient to fix the problem.
Original comment by Chris Billington (Bitbucket: cbillington, GitHub: chrisjbillington).
Fix issue #48
→ \<\<cset 382e92880a5b1d473072538a3ef2b23ca734f0c1>>
Original comment by Chris Billington (Bitbucket: cbillington, GitHub: chrisjbillington).
Merged in cbillington/blacs/bugfix (pull request #55)
Fix issue #48
→ \<\<cset 5a4ca1d6dbc1f065fd895c69efe88a45caf30fde>>
Original comment by Chris Billington (Bitbucket: cbillington, GitHub: chrisjbillington).
Merged in cbillington/blacs/bugfix (pull request #55)
Fix issue #48
→ \<\<cset 5a4ca1d6dbc1f065fd895c69efe88a45caf30fde>>
Original report (archived issue) by Philip Starkey (Bitbucket: pstarkey, GitHub: pstarkey).
The code to gracefully handle device tabs that raise exceptions (when they are instantiated) is broken. It modifies the dictionary we are iterating over, which then raises it's own exception (at least under Python 3.6).
We should store the devices to remove in a list, and then remove them after we have attempted to initialise each device tab.
See lines 277 and 291 here