Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit ebb33a2

Browse files
committed
Start making backport_pr work on Python 3
1 parent 78f245f commit ebb33a2

1 file changed

Lines changed: 6 additions & 3 deletions

File tree

tools/backport_pr.py

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,10 @@
2626
import sys
2727

2828
from subprocess import Popen, PIPE, check_call, check_output
29-
from urllib import urlopen
29+
try:
30+
from urllib.request import urlopen
31+
except:
32+
from urllib import urlopen
3033

3134
from gh_api import (
3235
get_issues_list,
@@ -45,8 +48,8 @@ def find_rejects(root='.'):
4548
def get_current_branch():
4649
branches = check_output(['git', 'branch'])
4750
for branch in branches.splitlines():
48-
if branch.startswith('*'):
49-
return branch[1:].strip()
51+
if branch.startswith(b'*'):
52+
return branch[1:].strip().decode('utf-8')
5053

5154
def backport_pr(branch, num, project='ipython/ipython'):
5255
current_branch = get_current_branch()

0 commit comments

Comments
 (0)