Skip to content

Commit

Permalink
2to3 migration.
Browse files Browse the repository at this point in the history
  • Loading branch information
teleyinex committed Sep 12, 2017
1 parent 7a942f5 commit f464c9d
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 6 deletions.
2 changes: 2 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@ sudo: false
language: python
python:
- "2.7"
- "3.5"
- "3.6"
install:
- pip install -r requirements.txt
- pip install -r requirements-testing.txt
Expand Down
12 changes: 6 additions & 6 deletions pbsonesignal/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
"""
import requests
from exceptions import *
from .exceptions import *


class PybossaOneSignal(object):
Expand Down Expand Up @@ -51,7 +51,7 @@ def __init__(self, api_key=None, app_id=None, app_ids=None, auth_key=None):
else:
self.app_ids = app_ids
except Exception as e:
print "ERROR: %s: %s" % (type(e), e)
print("ERROR: %s: %s" % (type(e), e))
raise e

def header(self, auth):
Expand Down Expand Up @@ -130,12 +130,12 @@ def push_msg(self, contents={"en": "English Message"},

response = req.json()

if 'errors' in response.keys():
if 'errors' in list(response.keys()):
for error in response['errors']:
raise CreateNotification(error)
return (req.status_code, req.reason, req.json())
except CreateNotification as e:
print "ERROR: %s: %s" % (type(e), e)
print("ERROR: %s: %s" % (type(e), e))
raise e

def create_app(self, name,
Expand Down Expand Up @@ -163,11 +163,11 @@ def create_app(self, name,

response = req.json()

if 'errors' in response.keys():
if 'errors' in list(response.keys()):
for error in response['errors']:
raise CreateApp(error)
return (req.status_code, req.reason, req.json())
except CreateApp as e:
print "ERROR: %s: %s" % (type(e), e)
print("ERROR: %s: %s" % (type(e), e))
raise e

0 comments on commit f464c9d

Please sign in to comment.