main: JsonDecodeError isn't available on python2.

This commit is contained in:
Damir Jelić 2019-09-11 20:28:27 +02:00
parent c69f859da4
commit 6cc6da45ec

View file

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