Skip to content

Commit

Permalink
Python3: stbt-control-relay: Pass a unicode keyname to press()
Browse files Browse the repository at this point in the history
The remote-control implementations expect to receive a native string
type: Either bytes or unicode on Python 2, or only str (unicode) on
Python 3.

This fixes `test_stbt_control_relay` on Python 3, as the
`FileControl.press()` used by the test doesn't support bytes.
  • Loading branch information
drothlis committed May 23, 2019
1 parent 494972c commit 4c3be23
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions stbt_control_relay.py
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,7 @@ def main(argv):
key = m.group("key")
logging.debug("Received %s %s", action, key)
try:
key = key.decode("utf-8")
if action == b"SEND_ONCE":
control.press(key)
elif action == b"SEND_START":
Expand Down

0 comments on commit 4c3be23

Please sign in to comment.