summaryrefslogtreecommitdiff
path: root/cdsapi
diff options
context:
space:
mode:
authorAlessandro Amici <a.amici@bopen.eu>2018-05-18 09:20:10 +0200
committerAlessandro Amici <a.amici@bopen.eu>2018-05-18 20:22:48 +0200
commitb999c1c23972fc81e67023273966e8c4630c4dc6 (patch)
treef1061fe1335ec52d2c2b473cd9802cad2485304e /cdsapi
parente791c4fbf4efe857981f175641a976bae3f5681e (diff)
Start some light python2 compatibility layer.
Diffstat (limited to 'cdsapi')
-rw-r--r--cdsapi/__init__.py5
-rw-r--r--cdsapi/api.py5
2 files changed, 7 insertions, 3 deletions
diff --git a/cdsapi/__init__.py b/cdsapi/__init__.py
index e7cdf1b..c9e9d4e 100644
--- a/cdsapi/__init__.py
+++ b/cdsapi/__init__.py
@@ -16,7 +16,8 @@
# granted to it by virtue of its status as an intergovernmental organisation nor
# does it submit to any jurisdiction.
+from __future__ import absolute_import, division, print_function, unicode_literals
-import cdsapi.api
+from . import api
-Client = cdsapi.api.Client
+Client = api.Client
diff --git a/cdsapi/api.py b/cdsapi/api.py
index 0ada51b..c15c84c 100644
--- a/cdsapi/api.py
+++ b/cdsapi/api.py
@@ -6,12 +6,15 @@
# granted to it by virtue of its status as an intergovernmental organisation nor
# does it submit to any jurisdiction.
-import requests
+from __future__ import absolute_import, division, print_function, unicode_literals
+
import json
import time
import os
import logging
+import requests
+
def bytes_to_string(n):
u = ['', 'K', 'M', 'G', 'T', 'P']