Browse Source

fix python 3.4 jsonerror import

Guénaël Muller 7 years ago
parent
commit
186be208cd
1 changed files with 4 additions and 2 deletions
  1. 4 2
      tracim/lib/utils/auth.py

+ 4 - 2
tracim/lib/utils/auth.py View File

@@ -1,7 +1,9 @@
1 1
 # -*- coding: utf-8 -*-
2 2
 import typing
3
-
4
-from json.decoder import JSONDecodeError
3
+try:
4
+    from json.decoder import JSONDecodeError
5
+except ImportError:  # python3.4
6
+    JSONDecodeError = ValueError
5 7
 from sqlalchemy.orm.exc import NoResultFound
6 8
 
7 9
 from pyramid.request import Request