Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix UnboundLocalErrors and KeyError #6

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open

Conversation

markk
Copy link

@markk markk commented Feb 9, 2020

Fixes for two errors encountered when switching outputs to spdif-optical.

Mark Knoop added 2 commits February 9, 2020 12:24
Without this a KeyError is returned when using args.digital_in as the Enum key.

./audiofuse-cli.py --digital_in spdif-optical -r
AudioFuse Digital I/O set to Input.ADAT and Output.ADAT
Found an AudioFuse.
Traceback (most recent call last):
  File "./audiofuse-cli.py", line 341, in <module>
    main()
  File "./audiofuse-cli.py", line 334, in main
    af.set_digital_in(Input[args.digital_in])
  File "/usr/lib64/python3.7/enum.py", line 352, in __getitem__
    return cls._member_map_[name]
KeyError: 'spdif-optical'
./audiofuse-cli.py --digital_in spdif-optical
AudioFuse Digital I/O set to Input.ADAT and Output.ADAT
Found an AudioFuse.
Attempting to set digital in to: Input.SPDIF_optical
Traceback (most recent call last):
  File "./audiofuse-cli.py", line 343, in <module>
    main()
  File "./audiofuse-cli.py", line 336, in main
    af.set_digital_in(Input[args.digital_in])
  File "./audiofuse-cli.py", line 129, in set_digital_in
    self._change_digital_in(val, restart, to_adat)
UnboundLocalError: local variable 'to_adat' referenced before assignment
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant