Skip to content

Commit 3308bd9

Browse files
authored
Check if Controller device is open before opening (#2779)
Before this commit, the `__init__` of the `InputManager` could fail if a controller had already been open. This could occur if an `InputManager` was instantiated twice. This commit closes issue #2778.
1 parent 34b50de commit 3308bd9

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

arcade/future/input/manager.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,9 @@ def __init__(
114114
self.controller_deadzone = controller_deadzone
115115
if controller:
116116
self.controller = controller
117-
self.controller.open()
117+
if not self.controller.device.is_open:
118+
self.controller.open()
119+
118120
self.controller.push_handlers(
119121
self.on_button_press,
120122
self.on_button_release,

0 commit comments

Comments
 (0)