Explorar el Código

fix python 3.4 jsonerror import

Guénaël Muller hace 7 años
padre
commit
186be208cd
Se han modificado 1 ficheros con 4 adiciones y 2 borrados
  1. 4 2
      tracim/lib/utils/auth.py

+ 4 - 2
tracim/lib/utils/auth.py Ver fichero

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