Skip to content

Commit 2321dbe

Browse files
committed
handle missing py27 JSONDecodeError
1 parent cdbf4e4 commit 2321dbe

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

qiita_client/qiita_client.py

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,13 @@
1212
import requests
1313
import threading
1414
import pandas as pd
15-
from json import dumps, loads, JSONDecodeError
15+
from json import dumps, loads
16+
try:
17+
from json import JSONDecodeError
18+
except ImportError:
19+
# dirty hack to cope with the fact that python 2.7 does not have
20+
# JSONDecodeError, but is needed for qp-target-gene plugin
21+
JSONDecodeError = ValueError
1622
from random import randint
1723
import fnmatch
1824
from io import BytesIO

0 commit comments

Comments
 (0)