main: JsonDecodeError isn't available on python2.
This commit is contained in:
parent
c69f859da4
commit
6cc6da45ec
1 changed files with 6 additions and 1 deletions
7
main.py
7
main.py
|
@ -43,7 +43,12 @@ import json
|
||||||
import OpenSSL.crypto as crypto
|
import OpenSSL.crypto as crypto
|
||||||
from future.utils import bytes_to_native_str as n
|
from future.utils import bytes_to_native_str as n
|
||||||
from logbook import Logger, StreamHandler
|
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
|
from nio import RemoteProtocolError, RemoteTransportError, TransportType
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue