Fix UnboundLocalError raised when Device is attached to a Group-Track #43
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Fixes #42
When scanning a file / set tracks are iterated and handled differently based on the is_foldable field. In the case where it foldable it is locally defined as group and in the case where it isn't it is defined as track. Later in the function it is assumed that track is already defined. However this won't be the case if the track was foldable / was a group. As a result the follow error is raised:
To reproduce: add a device to a Group and then try to instantiate a Set with scan=True
Changes
group
instance totrack
(it is technically a track and this resolves the unbound issue since it will then be defined later in the function)Group
track in the Tests.als file. (see note below about Live version of the Tests.als file)Testing
With the updated Tests.als file (and without this fix) the current tests will break when the Set fixture attempts to init with scan=True. With this fix, the issue is resolved.
NOTE: I'm on Live 12.0.1 and as such am only able to save the Tests.als as a v12 Live file. If we're not comfortable bumping, someone may need to apply my change and save in the current v11 edition.