The script is clearly broken due to scoping rules in python3:
for rot in rotations:
try:
raise xrandr.RRError # added to test this
status = rotate_screen(rotations[rot]) except(xrandr.RRError, xrandr.UnsupportedRRError) as error:
status = 1
else:
error = 'N/A'
# Collect the status and the error message rots_statuses[rot] = (status, error)
The variable 'error' is not in scope at the last line as it's only bound during the except handler.
The script is clearly broken due to scoping rules in python3:
for rot in rotations: screen( rotations[ rot])
except( xrandr. RRError, xrandr. UnsupportedRREr ror) as error:
rots_statuses[ rot] = (status, error)
try:
raise xrandr.RRError # added to test this
status = rotate_
status = 1
else:
error = 'N/A'
# Collect the status and the error message
The variable 'error' is not in scope at the last line as it's only bound during the except handler.