Skip to content

Commit 00a0639

Browse files
Alvaro Navarroalnacle
authored andcommitted
Remove Python 2 support
1 parent c77debe commit 00a0639

10 files changed

Lines changed: 11 additions & 34 deletions

File tree

.travis.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
language: python
22
cache: pip
33
python:
4-
- '2.7'
54
- '3.4'
65
- '3.5'
76
- '3.6.3' # explicit branch used for deploying

README.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ Amadeus provides a rich set of APIs for the travel industry. For more details, c
1111
Installation
1212
------------
1313

14-
This SDK requires Python 2.7+ or 3.4+. You can install it directly with pip:
14+
This SDK requires Python 3.4+ (Python 2+ is no longer supported). You can install it directly with pip:
1515

1616
.. code:: sh
1717

amadeus/client/request.py

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,9 @@
1-
# Support Python 2 and 3 API calls without importing
2-
# a 3rd party library
1+
# Support Python API calls without importing 3rd party library
32

43
import json
54

6-
try:
7-
from urllib.request import Request as HTTPRequest
8-
from urllib.parse import urlencode
9-
except ImportError: # pragma: no cover
10-
from urllib2 import Request as HTTPRequest # pragma: no cover
11-
from urllib import urlencode # pragma: no cover
5+
from urllib.request import Request as HTTPRequest
6+
from urllib.parse import urlencode
127

138

149
class Request(object):

amadeus/mixins/http.py

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,6 @@
11
from platform import python_version
22
from pprint import pformat
3-
try:
4-
from urllib.error import URLError
5-
except ImportError: # pragma: no cover
6-
from urllib2 import Request as URLError # pragma: no cover
3+
from urllib.error import URLError
74

85
from amadeus.version import version
96
from amadeus.client.request import Request

amadeus/mixins/validator.py

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,7 @@
22
import sys
33
import logging
44

5-
try:
6-
from urllib.request import urlopen
7-
except ImportError: # pragma: no cover
8-
from urllib2 import urlopen # pragma: no cover
5+
from urllib.request import urlopen
96

107

118
# A set of helper methods to allow the validating of

amadeus/shopping/flight_offers/_pricing.py

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
11
from amadeus.client.decorator import Decorator
2-
try:
3-
from urllib.parse import urlencode
4-
except ImportError: # pragma: no cover
5-
from urllib import urlencode # pragma: no cover
2+
3+
from urllib.parse import urlencode
64

75

86
class FlightOffersPrice(Decorator, object):

setup.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,6 @@
3131
'License :: OSI Approved :: MIT License',
3232
'Operating System :: OS Independent',
3333
'Programming Language :: Python',
34-
'Programming Language :: Python :: 2.7',
3534
'Programming Language :: Python :: 3.4',
3635
'Programming Language :: Python :: 3.5',
3736
'Programming Language :: Python :: 3.6',

specs/client/request_spec.py

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,7 @@
22
from expects import expect, equal, be_true, be_none, be_a
33
from amadeus import Request
44

5-
try:
6-
from urllib.request import Request as HTTPRequest
7-
except ImportError: # pragma: no cover
8-
from urllib2 import Request as HTTPRequest # pragma: no cover
5+
from urllib.request import Request as HTTPRequest
96

107

118
with description('Request') as self:

specs/mixins/http_spec.py

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,7 @@
22
from doublex import Spy, Stub, method_returning, method_raising
33
from doublex_expects import have_been_called_with, have_been_called
44
from expects import expect, equal, raise_error
5-
6-
try:
7-
from urllib.error import URLError
8-
except ImportError: # pragma: no cover
9-
from urllib2 import Request as URLError # pragma: no cover
5+
from urllib.error import URLError
106

117
from amadeus import Client, Response, ResponseError
128

tox.ini

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
[tox]
2-
envlist = py27,py34,py35,py36
2+
envlist = py34,py35,py36
33

44
[testenv]
55
commands =
@@ -16,7 +16,6 @@ deps =
1616
usedevelop=True
1717

1818
[tox:travis]
19-
2.7 = py27
2019
3.4 = py34
2120
3.5 = py35
2221
3.6 = py36

0 commit comments

Comments
 (0)