Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Drop support for python2. #6

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 5 additions & 16 deletions ecmwfapi/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,28 +7,17 @@
# granted to it by virtue of its status as an intergovernmental organisation nor
# does it submit to any jurisdiction.

# make the python3-like print behave in python 2
from __future__ import print_function

import os
import sys
import time
import traceback
from contextlib import closing

# python 2 and 3 compatible urllib and httplib imports
try:
from urllib.parse import urlparse
from urllib.parse import urljoin
from urllib.error import HTTPError, URLError
from urllib.request import HTTPRedirectHandler, Request, build_opener, urlopen, addinfourl
from http.client import BadStatusLine
except ImportError:
from urlparse import urlparse
from urlparse import urljoin
from urllib2 import HTTPError, URLError
from urllib2 import HTTPRedirectHandler, Request, build_opener, urlopen, addinfourl
from httplib import BadStatusLine
from http.client import BadStatusLine
from urllib.error import HTTPError, URLError
from urllib.parse import urljoin
from urllib.parse import urlparse
from urllib.request import HTTPRedirectHandler, Request, build_opener, urlopen, addinfourl

try:
import json
Expand Down