From 5dfce2aafe5f7d2edbe844f321cd0c62279eb794 Mon Sep 17 00:00:00 2001 From: Ponky Date: Fri, 4 Mar 2016 16:10:31 +0100 Subject: [PATCH 1/2] add python 3 compatibility --- pypipedrive/__init__.py | 2 +- pypipedrive/api.py | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/pypipedrive/__init__.py b/pypipedrive/__init__.py index 2fe4072..e55aaa0 100644 --- a/pypipedrive/__init__.py +++ b/pypipedrive/__init__.py @@ -1,3 +1,3 @@ -from api import PipeDrive +from .api import PipeDrive __version__ = '0.1.1' diff --git a/pypipedrive/api.py b/pypipedrive/api.py index 274dadc..a65bdcd 100644 --- a/pypipedrive/api.py +++ b/pypipedrive/api.py @@ -10,7 +10,7 @@ logger = logging.getLogger('pypipedrive') -class PipeDriveError(StandardError): +class PipeDriveError(Exception): pass @@ -76,7 +76,7 @@ def get_response(self, base_url, **kwargs): base = base_url.split('.') base = '/'.join([self.format_url_attr(s, kwargs) for s in base]) params = dict( - (k, v) for k, v in kwargs.iteritems() if not k.startswith('_')) + (k, v) for k, v in iter(kwargs) if not k.startswith('_')) if 'method' in params: method = params['method'] del params['method'] @@ -112,4 +112,4 @@ def format_url_attr(self, str, params): api_token = environ.get('PIPEDRIVE_API_TOKEN') p = PipeDrive(api_token) r = p.persons(limit=5) - print r + print(r) From 606cff2f25ca4db49c3bdcb464010fc8a1acc23a Mon Sep 17 00:00:00 2001 From: Ponky Date: Thu, 10 Mar 2016 10:31:14 +0100 Subject: [PATCH 2/2] add python 3 compatibility --- pypipedrive/api.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pypipedrive/api.py b/pypipedrive/api.py index a65bdcd..d1e3af1 100644 --- a/pypipedrive/api.py +++ b/pypipedrive/api.py @@ -76,7 +76,7 @@ def get_response(self, base_url, **kwargs): base = base_url.split('.') base = '/'.join([self.format_url_attr(s, kwargs) for s in base]) params = dict( - (k, v) for k, v in iter(kwargs) if not k.startswith('_')) + (k, v) for k, v in kwargs.items() if not k.startswith('_')) if 'method' in params: method = params['method'] del params['method']