Fix crashing when running on Windows

This commit is contained in:
redphx 2022-04-23 10:24:44 +07:00
parent d2474959ce
commit 2c43fac7ab
2 changed files with 5 additions and 4 deletions

View File

@ -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
<details>

View File

@ -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'],