Browse Source

fix python 3.4 httpstatus compat

Guénaël Muller 7 years ago
parent
commit
d34f40aa41
1 changed files with 4 additions and 2 deletions
  1. 4 2
      tracim/views/example_api/example_api_controller.py

+ 4 - 2
tracim/views/example_api/example_api_controller.py View File

@@ -1,8 +1,10 @@
1 1
 # -*- coding: utf-8 -*-
2 2
 # TODO - G.M - 10-04-2018 - [cleanup][tempExample] - Drop this file
3 3
 from datetime import datetime
4
-from http import HTTPStatus
5
-
4
+try:  # Python 3.5+
5
+    from http import HTTPStatus
6
+except ImportError:
7
+    from http import client as HTTPStatus
6 8
 from pyramid.config import Configurator
7 9
 
8 10
 from hapic.data import HapicData