From 6cc6da45ec414cafb1f51c6f072b5b4bdb4cc2f5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Damir=20Jeli=C4=87?= Date: Wed, 11 Sep 2019 20:28:27 +0200 Subject: [PATCH] main: JsonDecodeError isn't available on python2. --- main.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/main.py b/main.py index 9d61759..2b5cf07 100644 --- a/main.py +++ b/main.py @@ -43,7 +43,12 @@ import json import OpenSSL.crypto as crypto from future.utils import bytes_to_native_str as n from logbook import Logger, StreamHandler -from json.decoder import JSONDecodeError + +try: + from json.decoder import JSONDecodeError +except ImportError: + JSONDecodeError = ValueError # type: ignore + from nio import RemoteProtocolError, RemoteTransportError, TransportType