Refactor to run in both Python 2.7 and Python 3.6

Refactor to run in both Python 2.7 and Python 3.6. This is important as
python 2.7 is end of life.

I tried to edit as few things as possible in this commit to minimize
conflicts which means the code could be prettier.

Signed-off-by: Viktor Sjölind <viktor@sjolind.se>
This commit is contained in:
Viktor Sjölind 2017-06-09 15:19:24 +02:00 committed by Jonatan Pålsson
parent 2125b2d739
commit 96e6da2752
5 changed files with 80 additions and 74 deletions

View file

@ -69,7 +69,7 @@ class PullRequest:
for repo in self.repos:
r = requests.get(repo["uri"])
if r.status_code != 200:
print "Error fetching %s", repo["name"]
print("Error fetching %s", repo["name"])
break
prs = r.json()
@ -83,4 +83,4 @@ class PullRequest:
if __name__ == "__main__":
p = PullRequest()
for line in p.check_all():
print line["message"]
print(line["message"])