You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Context: I ran start_test_app on an instance of a custom driver which contained DictFeats initialized without specifying a keys=() argument. The following error shows up:
Traceback (most recent call last):
File "C:\Anaconda3\lib\site-packages\lantz\ui\widgets.py", line 528, in __init__
feat_widget = LabeledFeatWidget(self, target, feat)
File "C:\Anaconda3\lib\site-packages\lantz\ui\widgets.py", line 415, in __init__
self._widget = DictFeatWidget(parent, target, feat)
File "C:\Anaconda3\lib\site-packages\lantz\ui\widgets.py", line 340, in __init__
wid.feat_key = self._keys[0]
AttributeError: 'DictFeatWidget' object has no attribute '_keys'
Probable origin: In that case, keys default to None so when the DictFeatWidget is created by start_test_app the _keys attribute is not set within the if feat.keys statement before wid.feat_key = self._keys[0] is run, leading to the error.
Probable fix: wid.feat_key = self._keys[0] should only be run when keys exist.
Context: I ran start_test_app on an instance of a custom driver which contained DictFeats initialized without specifying a
keys=()
argument. The following error shows up:Probable origin: In that case,
keys
default toNone
so when theDictFeatWidget
is created bystart_test_app
the_keys
attribute is not set within the iffeat.keys
statement beforewid.feat_key = self._keys[0]
is run, leading to the error.Probable fix:
wid.feat_key = self._keys[0]
should only be run when keys exist.Proposed fix: rewrite
DictFeatWidget.__init__
asThe text was updated successfully, but these errors were encountered: