Skip to content

Commit b8a5c96

Browse files
author
Guillaume Badi
committed
python 3 compat
1 parent 460d51d commit b8a5c96

File tree

4 files changed

+6
-5
lines changed

4 files changed

+6
-5
lines changed

.travis.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ language: python
33
python:
44
- "2.6"
55
- "2.7"
6+
- "3.5.0"
67

78
install: "pip install -r requirements.txt"
89
script: python test.py

mailjet/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
#!/usr/bin/env python
22
# coding=utf-8
33

4-
from client import Client
4+
from .client import Client
55

66
__version__ = '0.1.0'
77
__all__ = ('Client',)

mailjet/client.py

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -67,9 +67,9 @@ def __getattr__(self, name):
6767
if (len(split) > 1):
6868
action = split[1]
6969
if action == 'csvdata':
70-
action = 'csvdata/text:plain'
70+
action = 'csvdata/text:plain'
7171
if action == 'csverror':
72-
action = 'csverror/text:csv'
72+
action = 'csverror/text:csv'
7373
url, headers = self.config[name]
7474
return type(fname, (Endpoint,), {})(url=url, headers=headers, action=action, auth=self.auth)
7575

@@ -92,8 +92,6 @@ def api_call(auth, method, url, headers, data=None, filters=None, resource_id=No
9292
raise TimeoutError
9393
except requests.RequestException as e:
9494
raise ApiError(e)
95-
except ValidationError, e:
96-
raise
9795
except Exception as e:
9896
raise
9997

requirements.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,4 @@
11
requests
2+
urllib3
3+
chardet2
24
logging

0 commit comments

Comments
 (0)