From 2c43fac7abb9cec22826f2de3a5fdac99a2ee6fe Mon Sep 17 00:00:00 2001 From: redphx <96280+redphx@users.noreply.github.com> Date: Sat, 23 Apr 2022 10:24:44 +0700 Subject: [PATCH] Fix crashing when running on Windows --- README.md | 3 --- dance.py | 6 +++++- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 747fa8d..cb6ee26 100644 --- a/README.md +++ b/README.md @@ -47,9 +47,6 @@ It pretends to be the [Just Dance Controller app](https://play.google.com/store/ ``` pip3 install -r requirements.txt ``` - -#### Extra step for Windows users -Please make [this change](../../issues/3#issuecomment-1101087415). It's only a temporary fix, and will be patched in future versions. #### Extra steps for Linux users
diff --git a/dance.py b/dance.py index 8801129..71c1ee5 100644 --- a/dance.py +++ b/dance.py @@ -1,6 +1,7 @@ import asyncio import json import logging +import platform import re import socket import time @@ -81,7 +82,10 @@ async def get_joycon_list(app): break color = '#%02x%02x%02x' % joycon.color_body - joycon.__del__() + + # Temporary fix for Windows + if platform.system() != 'Windows': + joycon.__del__() info = { 'vendor_id': dev['vendor_id'],