Skip to content

UnboundLocalError raised when Device is attached to a Group-Track  #42

@ryannikolaidis

Description

@ryannikolaidis

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:

                for device_index, device_data in enumerate(track_data["devices"]):
>                   device = Device(track, device_index, device_data["name"])
E                   UnboundLocalError: local variable 'track' referenced before assignment

To reproduce: add a device to a Group and then try to instantiate a Set with scan=True

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions