Skip to content

Commit e201622

Browse files
committed
Check tuple length in examples
1 parent fa94bf3 commit e201622

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

README.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -134,7 +134,7 @@ Usage Example
134134
out_str = f"{mouse.x},{mouse.y}"
135135
136136
# add pressed buttons to out str
137-
if pressed_btns is not None:
137+
if pressed_btns is not None and len(pressed_btns) > 0:
138138
out_str += f" {" ".join(pressed_btns)}"
139139
140140
# update the text label with the new coordinates

examples/usb_host_mouse_simpletest.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@
4646
out_str = f"{mouse.x},{mouse.y}"
4747

4848
# add pressed buttons to out str
49-
if pressed_btns is not None:
49+
if pressed_btns is not None and len(pressed_btns) > 0:
5050
out_str += f" {" ".join(pressed_btns)}"
5151

5252
# update the text label with the new coordinates

0 commit comments

Comments
 (0)