From 153396acbb24cdf14049161a13cf72a94c07b900 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Odd=20Str=C3=A5b=C3=B8?= Date: Mon, 22 Feb 2021 04:10:32 +0100 Subject: [PATCH] array.array.tostring is removed in Python 3.9 --- jellyfin_kodi/jellyfin/websocket.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/jellyfin_kodi/jellyfin/websocket.py b/jellyfin_kodi/jellyfin/websocket.py index 258ad5ce..20e159d8 100644 --- a/jellyfin_kodi/jellyfin/websocket.py +++ b/jellyfin_kodi/jellyfin/websocket.py @@ -36,6 +36,7 @@ except ImportError: import os +import sys import array import struct import uuid @@ -357,7 +358,11 @@ class ABNF(object): _d = array.array("B", data) for i in range(len(_d)): _d[i] ^= _m[i % 4] - return _d.tostring() + + if sys.version_info >= (3, 2): + return _d.tobytes() + else: + return _d.tostring() class WebSocket(object):